git 分支重命名

1. Rename your local branch.
If you are on the branch you want to rename:

git branch -m new-name
If you are on a different branch:

git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch.

git push origin :o ld-name new-name

3. Reset the upstream branch for the new-name local branch.
Switch to the branch and then:

git push origin -u new-name
此条目发表在 git 分类目录。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*


*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>