总结一:本地创建本地分支并切换
# 针对当前cas-thymeleaf 创建一个cas 分支
Administrator@PC-20180603XCNG MINGW64 /d/git_workspace/cas-thymeleaf (main)
$ git branch cas
# 将当前cas-thymeleaf 由main 主分支切换至cas 分支
Administrator@PC-20180603XCNG MINGW64 /d/git_workspace/cas-thymeleaf (main)
$ git checkout cas
Switched to branch 'cas'
![](https://img-blog.csdnimg.cn/821fb86dee174ebda5fff533dfefac11.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Zyo5aWL5paX55qE5aSn6YGT,size_15,color_FFFFFF,t_70,g_se,x_16)
总结二:本地本地分支推送远程分支
#推送本地的cas(冒号前面的)分支到远程origin的cas(冒号后面的)分支(没有会自动创建)
Administrator@PC-20180603XCNG MINGW64 /d/git_workspace/cas-thymeleaf (cas)
$ git push origin cas:cas
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'cas' on GitHub by visiting:
remote: https://github.com/zhouzhiwengang/springboot_demo/pull/new/cas
remote:
To github.com:zhouzhiwengang/springboot_demo.git
* [new branch] cas -> cas
![](https://img-blog.csdnimg.cn/b4023b0d08ae4cb1bd8671244dad09bb.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Zyo5aWL5paX55qE5aSn6YGT,size_15,color_FFFFFF,t_70,g_se,x_16)
总结三:分支代码合并
git merge 分支名称