问题
I recently moved my 'main' remote git repository from code.google
to github
. Then, I renamed old origin
repo to code-google
and previously created remote github
to origin
. So far so good.
But...
There are still references in .git/refs/remotes
:
code-google github origin
I tried this, but it does not seem to be working:
$ git remote prune github --dry-run
fatal: 'github' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Why is github still there since it was renamed? Why am I not able to dispose of it? And how can I clean up my repo?
回答1:
This thread mentions that renaming the remote isn't enough:
If you want to be really complete, you should also delete your '
origin
' refs :
rm -R .git/refs/remotes/origin
A safer way would be to clone your new remote repo (now on GitHub), and add another remote.
来源:https://stackoverflow.com/questions/14426231/why-is-old-name-of-git-remote-sill-in-git-refs-remotes