简体   繁体   中英

Why is old name of git remote sill in .git/refs/remotes?

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?

This thread (now deleted) 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM