前面10篇文章都在用命令行,虽然装逼不错,但是我想说一句,平时我也是用source tree比较多点,命令行一般都是在source tree的图形按钮找不到在哪里,就直接用命令行。对于初次用git的同学,还是来看看source tree怎么用的吧。我用的电脑是mac,可能和windows上的source tree不太一样,不过应该不会有很大差别。
source tree初始界面

初始界面
当我们刚安装好source tree的时候,可以看到上图的对话框,这个时候如果我们本地已经有一个仓库了,就可以拖拽到这个对话框上,如果想新建一个仓库,可以点击New Repository
。
新建仓库
下图是新建菜单,这里不演示了。

Paste_Image.png
主界面
切换显示模式

显示模式
我们一般都在View模式上查看log树
功能菜单
我们主要的操作都在功能菜单上

功能菜单
log
图形界面最吸引人的就是树形界面吧

日志区域
commit信息
如果在log区域选择了一个commit,就可以在红圈处看到commit信息和文件

commit信息
diff
可以方便的看到差异

diff
切换分支
很多命令都不需要敲了

切换分支
拉代码
这里看一个具体操作吧。其他命令就不演示了。

拉代码
配置比较合并工具
我们可以配置比较合并工具,从图中可以看到我配置的是beyond compare。如何配置可以看这个文章sourcetree config beyond compare

配置比较工具
使用比较工具

工具
使用git flow
要了解工作流程的看官可以看一下Comparing Workflows
- 初次点击git flow
使用git flow
- 初次点击,第二次在点击git flow
使用git flow
- 选择创建一个新功能试试看啥效果
填写功能名字new feature - 创建以后啥样子呢
git flow建议我们在新的分支上开发新功能多了一个新的分支 - 开发好了我要提交功能
开发好了新功能
- 完成feature
完成feature点击完成
点击rebase保证历史记录结构简单
点击rebase保证历史记录结构简单 - 结局
点击完成后,我们会回到develop分支点击完成后
文/沈寅(简书作者)原文链接:http://www.jianshu.com/p/d9e432ad408d