要查看您的遙控器正在發生什麼,請使用git remote -v
命令。它會產生這樣的:
$ git remote -v
bakkdoor https://github.com/bakkdoor/grit (fetch)
bakkdoor https://github.com/bakkdoor/grit (push)
cho45 https://github.com/cho45/grit (fetch)
cho45 https://github.com/cho45/grit (push)
origin [email protected]:mojombo/grit.git (fetch)
origin [email protected]:mojombo/grit.git (push)
說你想刪除遠程cho45回購,做到以下幾點:
$ git remote rm cho45
然後確認:
$ git remote -v
bakkdoor https://github.com/bakkdoor/grit (fetch)
bakkdoor https://github.com/bakkdoor/grit (push)
origin [email protected]:mojombo/grit.git (fetch)
origin [email protected]:mojombo/grit.git (push)
如果你想你的本地git忘記REMOTE回購,那麼你可以使用下面的過程。但是,它會烘托回購,真的確定你想要。
cd cho45/.git
rm -rf origin
cd refs/remotes
rm -rf origin
'git remote -v' list'origin'? – Roman
同時顯示'git show-ref'的輸出。 – Roman
我試圖重現這一點,並沒有發生。 'git remote remove origin;'具有所需的效果,使得'git log --all --decorate;'不顯示遠程分支。 –