I named a branch Name
instead of name
and would like to change it to the latter.
I tried renaming the branch locally:
git branch -m tmp
Deleting the branch on github:
git push origin --delete Name
Renaming the temp branch:
git branch -m name
Pushing the branch to github:
git push origin name
But when I push the branch to github, I get this output:
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/xx/xx.git
* [new branch] name -> Name
Why did github rename the branch when I pushed it? How can I rename my branch from Name
to name
?
Use git push origin name:name
to define how the branch will be called on the server. You probably have the remote branch name in your .git/config file which was not updated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With