我將一個git回購從https://github.com/username/testrepo.git移至https://github.com/companyname/testrepo.git,現在需要對該寶石做更多的工作。當我進入本地機器的目錄並鍵入git remote -v
時,它仍然顯示原點https://github.com/username/testrepo.git。Git/Github,移動並正確更新回購
我的問題是,我有什麼正確的方式來更新這個遠程與新的位置,並開始再次工作?
我將一個git回購從https://github.com/username/testrepo.git移至https://github.com/companyname/testrepo.git,現在需要對該寶石做更多的工作。當我進入本地機器的目錄並鍵入git remote -v
時,它仍然顯示原點https://github.com/username/testrepo.git。Git/Github,移動並正確更新回購
我的問題是,我有什麼正確的方式來更新這個遠程與新的位置,並開始再次工作?
首先拆下原點遠程:
git remote rm origin
然後,像這樣將其重命名:
git remote set-url origin [email protected]:companyname/testrepo.git
你不需要移除舊的遙控器。只更改原始網址就足夠了。 – Hauleth 2013-05-13 19:12:50
我除去'[紅寶石]'和'[軌]'標籤,因爲這與Ruby或Rails完全沒有任何關係。它也與GitHub沒有任何關係,但現在我留下了該標籤。 – 2013-05-13 19:08:46