Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename branch to remove capitalization?

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?

like image 560
Nate Avatar asked Sep 06 '14 20:09

Nate


1 Answers

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.

like image 81
knittl Avatar answered Sep 28 '22 15:09

knittl