move a branch path in git (change its name, not its code)

This question already has an answer here:

  • How do I rename a local Git branch? 28 answers

  • One way to do this would be to check out the remote branch to a temporary branch name locally, push to the new name on the remote, and then delete the remote branch. For example:

    git checkout -b tmp origin/release/service-release-2016
    

    Create the new remote branch:

    git push origin tmp:release/completed/service-release-2016
    

    Delete the old remote branch:

    git push origin :release/service-release-2016
    
    链接地址: http://www.djcxy.com/p/2604.html

    上一篇: git:重命名远程分支?

    下一篇: 在git中移动分支路径(更改其名称,而不是其代码)