xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

git change branch name All In One

git change branch name All In One

1. Start by switching to the local branch which you want to rename:
$ git checkout <old_name>

# 2. Rename the local branch by typing:
$ git branch -m <new_name>

# 3. Push the <new_name> local branch and reset the upstream branch:
$ git push origin -u <new_name>

# 4. Delete the <old_name> remote branch:
$ git push origin --delete <old_name>


refs

修改 git 分支名称

https://linuxize.com/post/how-to-rename-local-and-remote-git-branch/

https://stackoverflow.com/questions/6591213/how-do-i-rename-a-local-git-branch

https://devconnected.com/how-to-change-branch-name-on-git/



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-02-26 10:50  xgqfrms  阅读(190)  评论(0编辑  收藏  举报