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进阶(六):git 刷新分支、修改本地和远程分支名称_webstorm 刷新远程分支_No Silver Bullet的博客-CSDN博客 #79

Open
HenryTSZ opened this issue Sep 5, 2023 · 0 comments

Comments

@HenryTSZ
Copy link
Owner

HenryTSZ commented Sep 5, 2023

https://blog.csdn.net/sunhuaqiang1/article/details/104559153

文章目录


一、命令集

1.1 刷新分支

git remote update origin --prune

1.2 查看所有分支

git branch -a

1.3 查看远程分支

git branch -r

1.4 查看本地分支所关联的远程分支

git branch -vv

1.5 修改本地分支名称

git branch -m old_branch new_branch

1.6 删除远程旧分支

git push origin :old_branch

1.7 将新分支推送到远程仓库

git push --set-upstream origin new_branch

或者git push -u origin new_branch

注意:把origin改为自己的名称。

1.8 分支切换、合并

  • git checkout --track origin/dev 切换到远程dev分支
  • git branch -D master develop 删除本地库develop
  • git checkout -b dev 建立一个新的本地分支dev
  • git merge origin/dev 将分支dev与当前分支进行合并
  • git checkout dev 切换到本地dev分支

1.9 检出仓库

检出仓库:$ git clone git://github.com/jquery/jquery.git

二、命令图

三、拓展阅读

文章知识点与官方知识档案匹配,可进一步学习相关知识

Git技能树Git入门分支管理5987 人正在系统学习中

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

No branches or pull requests

1 participant