I have the branch master
which tracks the remote branch origin/master
.
I want to rename them to master-old
both locally and on the remote. Is this possible?
For other users who tracked origin/master
(and who always updated their local master
branch via git pull
), what would happen after I renamed the remote branch?
Would their git pull
still work or would it throw an error that it couldn't find origin/master
anymore?
Then, further on, I want to create a new master
branch (both locally and remote). Again, after I did this, what would happen now if the other users do git pull
?
I guess all this would result in a lot of trouble. Is there a clean way to get what I want? Or should I just leave master
as it is and create a new branch master-new
and just work there further on?
git push -f
affects the ability topull
from any remote tracking branch.master-old
that points to the same commit as the previousmaster
branch. Then you can overwrite themaster
branch with your new changes by doing amerge
with theours
strategy. Doing a merge works when the remote does not allow non-fastforward changes. That also means other users won't have forced updates.master
is only special as long as it's the only existing branch. As soon as you have more than one, all branches are on an equal footing.