Feeds:
Posts
Comments

Archive for September, 2023

Git rename branch

Checkout another branch, for example: “git checkout master”.
Now run “git branch -m <old name> <new name>”.
You can check if it went ok with “git branch -a” command.

Next time trying to push (on the new branch), you will get the error:

fatal: The upstream branch of your current branch does not match
the name of your current branch.

Solution for this is to run “git branch –unset-upstream”,
followed by “git push” (this will give you a hint to run “git push –set-upstream origin <new name>)

Read Full Post »