我不知道名爲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