Is it safe to rename remotes in git?

I have 2 remote controls - origin and remote2, and I want to rename remote2 to source and source. Is it safe? If so, how do I do this?

Edit: safely, I mean that if any branch is tracked from "origin", it will continue to be tracked from the "source" after renaming. I also want me to be new, what else could go wrong :)

+4
source share
1 answer

I believe that it is safe, yes, if you do not have scripts that refer to the remote by name, for example (in this case, they will still use the old remote name).

Team:

git remote rename <old> <new>

, - foo, foo bar, bar. , :

git remote -v show
git branch -a -v

.

+7

Source: https://habr.com/ru/post/1525113/


All Articles