点击工具下的创建或导入ssh密钥,选择load
![](https://img-blog.csdnimg.cn/img_convert/89a5b3dad86e1e339cd9220246275e73.png)
然后选择rsa文件
![](https://img-blog.csdnimg.cn/img_convert/97c0e08546e08a63383cc149d682ddb5.png)
这样就成功了
接下来,点击保存
![](https://img-blog.csdnimg.cn/img_convert/72620017758198c1b48b7b193fc774e0.png)
然后给文件取个名字
![](https://img-blog.csdnimg.cn/img_convert/328e8a4589295ae3548a1ab8f21f12f3.png)
然后点击工具下面的启动ssh助手
克隆git远程代码
复制ssh地址,点击克隆
出现下面这个问题:无效源路径
![](https://img-blog.csdnimg.cn/img_convert/0c783318ef02234dcc1b97420416f78c.png)
点击否,点击取消
接下来我们解决这个问题
点击工具,点击选项
![](https://img-blog.csdnimg.cn/img_convert/cc9edc93f053fbd7d256f19cb4bd4c9b.png)
重新启动软件
![](https://img-blog.csdnimg.cn/img_convert/abc6aa0b2eac5aa51aaf56575bd62fca.png)
点击克隆,可以选择克隆的位置
![](https://img-blog.csdnimg.cn/img_convert/6a5b31fbea5134d101f02ef0b22845c1.png)
然后用vscode打开文件夹
在sourceTree中创建分支
![](https://img-blog.csdnimg.cn/img_convert/6919e52b0cda451953061b6e2646841d.png)
检出分支就是切换分支
history就是版本库
当我在dev分支进行开发时,
![](https://img-blog.csdnimg.cn/img_convert/3f9bbda50955f49b95508c32788b799d.png)
点击加号就可以放到暂存区
![](https://img-blog.csdnimg.cn/img_convert/971990a02e64a5e71ab17f8e6947bcdf.png)
点击提交
![](https://img-blog.csdnimg.cn/img_convert/f446649c448b742936f0f8ed22151516.png)
查看历史
![](https://img-blog.csdnimg.cn/img_convert/ae52d88429f35640bc41f0a79f2e2f83.png)
再切换到master分支
![](https://img-blog.csdnimg.cn/img_convert/b4527dc438fa16a2e2c1b17dbbc9f45f.png)
![](https://img-blog.csdnimg.cn/img_convert/556525497380df5bf62aadfb9ca9d467.png)
接下来,合并分支
![](https://img-blog.csdnimg.cn/img_convert/93cb1eae8adc770c907372f61f1ff5cf.png)
出现合并冲突
![](https://img-blog.csdnimg.cn/img_convert/faf5831bb72ac269ef2d10f1790167ea.png)
![](https://img-blog.csdnimg.cn/img_convert/1a41da7a38bb272dd5ae35e34ed09475.png)
然后点击关闭
查看历史状态
![](https://img-blog.csdnimg.cn/img_convert/19c82de519ffa634955e9f8138ab5234.png)
![](https://img-blog.csdnimg.cn/img_convert/2286b7c1b1d1bee8cfca723a79128944.png)
加到暂存区,并且提交
![](https://img-blog.csdnimg.cn/img_convert/b13a2cc771c36ed1f364bab76ca9cdff.png)
然后可以推送分支
![](https://img-blog.csdnimg.cn/img_convert/301744aa426f4c6901a5e729bbc42e92.png)
到git上刷新就好了