Reputation: 13
I created a remote branch called origin/feature-BRANCH-NAME
from origin/master
and i accidentally typed a wrong branch name and I want to rename it using Eclipse.
How can I do that?
Upvotes: 0
Views: 7839
Reputation: 142094
https://wiki.eclipse.org/EGit/User_Guide#Renaming_an_Existing_Branch
Renaming an Existing Branch
>
Advanced >
Rename Branch...Using git command line:
# rename a local branch
git branch -m origin/feature-BRANCH-NAM <newname>
How to rename a remote branch?
Delete the old branch and push a new one with the new name
# delete the remote branch
git push origin - -delete <old name>
# checkout the new branch (after renamed as explained above)
git checkout <local new branch>
# push the new branch name
git push origin <new name>
Upvotes: 4