- 创建本地分支 local_branch
git branch local_branch
- 创建本地分支local_branch 并切换到该分支
git checkout -b local_branch
- 切换到分支local_branch
git checkout local_branch
- 推送本地分支local_branch到远程分支 remote_branch并建立关联关系
- 远程已有remote_branch分支并且已经关联本地分支local_branch且本地已经切换到local_branch
git push
- 远程已有remote_branch分支但未关联本地分支local_branch且本地已经切换到local_branch
git push -u origin remote_branch
- 远程没有有remote_branch分支并,本地已经切换到local_branch
git push origin local_branch:remote_branch
- 远程已有remote_branch分支并且已经关联本地分支local_branch且本地已经切换到local_branch
- 删除本地分支local_branch
git branch -d | -D local_branch
- 删除远程分支remote_branch
git branch -d -r remote_branch
7.重命名分支
git branch -m | -M 旧名称 新名称
- 查看分支
git branch -a
- 合并分支local_branch
git merge local_branch
分支
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。