Renaming a branch in GitHub

前端 未结 15 2296
面向向阳花
面向向阳花 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条回答
  •  -上瘾入骨i
    2020-12-02 04:11

    Just remove the old branch and create new one.

    Example (solely renaming the remote branch):

    git push origin :refs/heads/oldname
    git push origin newname:refs/heads/newname
    

    You also probably should rename local branch and change settings for where to push/pull.

提交回复
热议问题