GitHub入门与实践(2)掌握Git 2、分支操作
2016-02-12 23:08
531 查看
1)显示分支一览表
git branch
2) 创建、切换分支
git checkout -b
3)特性分支
集中实现单一特性(主题),除此之外不进行任何作业的分支。
4)主干分支
特性分支的原点,合并的终点。
master分支。
5)合并分支
git merge
6)以图表形式查看分支
git log --graph
git branch
$ git branch * master
2) 创建、切换分支
git checkout -b
$ git checkout -b feature-A Switched to a new branch 'feature-A' $ git branch feature-A $ git checkout feature-A $ git branch * feature-A master
<pre name="code" class="plain"> $ git add README.md $ git commit -m "Add feature-A" [feature-A 3bfe955] Add feature-A 1 file changed, 3 insertions(+), 1 deletion(-) $ git checkout master Switched to branch 'master' $ git checkout - Switched to branch 'feature-A'
3)特性分支
集中实现单一特性(主题),除此之外不进行任何作业的分支。
4)主干分支
特性分支的原点,合并的终点。
master分支。
5)合并分支
git merge
$ git checkout master Switched to branch 'master' $ git merge --no-ff feature-A Merge made by the 'recursive' strategy. README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
6)以图表形式查看分支
git log --graph
$ git log --graph * commit c86057c4c91d9ae4a841a9e80a1a971194103301 |\ Merge: 899bf31 3bfe955 | | Author: Wu Jian <Jamsonwoo@126.com> | | Date: Fri Feb 12 23:27:28 2016 +0800 | | | | Merge branch 'feature-A' | | | * commit 3bfe9559a43f5dd199b0b9b0fac615aabfd7aa8d |/ Author: Wu Jian <Jamsonwoo@126.com> | Date: Fri Feb 12 23:13:24 2016 +0800 | | Add feature-A | * commit 899bf3107f38542ea7a8cccc933abb3a420603b8 | Author: Wu Jian <Jamsonwoo@126.com> | Date: Fri Feb 12 22:42:31 2016 +0800 | | Add index | * commit 3f9014e2b31071d17f6d6d5ce144780a2e0dbf13 Author: Wu Jian <Jamsonwoo@126.com> Date: Fri Feb 12 22:17:23 2016 +0800 First commit
相关文章推荐
- RPC failed; result=22, HTTP code = 411
- 查看github pages文档的方式
- 使用BAE的基于Web.py的简单博客程序
- git更新已經刪除的文件
- 提取Git每次提交后Commit的文件
- GIT迁移服务器
- 分布式版本管理git入门指南使用资料汇总及文章推荐
- 只需十分钟,结果大不同 |《深度思考》
- 《洋葱阅读法》读书笔记
- git终极指南:在实际开发中的应用
- 两分钟学会如何在github托管代码
- Jquery实战_读书笔记1―选择jQuery
- JavaScript 精粹读书笔记(1,2)
- JavaScript 权威指南(第四版) 读书笔记
- Git远程操作详解
- Terry七月Ruby读书笔记(比较详细)第1/4页
- 25个 Git 进阶技巧(翻译)
- 详解版本控制利器Git,SVN的异同以及适用范围
- Android自定义View实现仿GitHub的提交活跃表格