Renaming a branch in GitHub

前端 未结 15 2303
面向向阳花
面向向阳花 2020-12-02 03:28

I just renamed my local branch using

git branch -m oldname newname

but this only renames the local version of the branch. How can I rename

15条回答
  •  醉梦人生
    2020-12-02 04:24

    The following commands worked for me:

    git push origin :old-name-of-branch-on-github
    git branch -m old-name-of-branch-on-github new-name-for-branch-you-want
    git push origin new-name-for-branch-you-want
    

提交回复
热议问题