我从origin/feature-BRANCH-NAME
创建了一个名为origin/master
的远程分支,我不小心输入了错误的分支名称,我想使用Eclipse重命名它。
我该怎么做?
答案 0 :(得分:2)
https://wiki.eclipse.org/EGit/User_Guide#Renaming_an_Existing_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 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>