我不知道名为origin
的远程设备是否已经存在。该命令如何在一个命令中创建或更新远程?
git remote add origin [email protected]
引发错误
fatal: remote origin already exists
我需要添加一个origin
远程如果不存在的话,和更新它,如果它已经存在。我怎么能在一个命令中做到这一点?
(有关信息,我使用的Git版本1.7.3.4)
此外,之间有什么区别:
git remote add origin [email protected]
git remote set-url origin [email protected]
git remote set-url --add origin [email protected]
这些命令中的任何一个都可以做我想要的吗?
上次命令中的“/ dev/null”是什么意思?其实“2>&1”? – bmalets 2015-04-01 16:47:59
@bmalets看我的编辑。 – Jubobs 2015-04-01 16:52:33
非常感谢您的帮助! – bmalets 2015-04-01 17:31:23