Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何修改已有的分支名称 | Git 入门(三) #10

Open
leeduckgo opened this issue May 10, 2020 · 0 comments
Open

如何修改已有的分支名称 | Git 入门(三) #10

leeduckgo opened this issue May 10, 2020 · 0 comments
Assignees

Comments

@leeduckgo
Copy link
Member

  • oldname
  • newname

1.git branch -m oldname newname(本地分支和远程分支的重命名都是这个)

2.git push --delete origin oldname(删除远程分支)

3.git push origin newname(上传新命名的本地分支)

4.git branch --set-upstream-to origin/newname(把本地分支与远程分支相关联)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants