官网: https://www.sourcetreeapp.com/
或者xclient下载: https://xclient.info/s/sourcetree.html  安装:   选择 bitbucket 之后需要路径以及账户密码~ 这个可能需要让你公司给开个账户密码吧
-
进入本地终端: cd ~/.ssh 输入 ssh-keygen -t rsa -C “账号(邮箱)” 会生成 id_rsa id_rsa.pub 俩个私钥和公钥。 后面连续三次回车就行~ 是俩个文件命名 以及 密码。 走默认就行。  -
然后输入命令: cat ~/.ssh/id_rsa.pub 查看公钥,复制粘贴到 github的ssh配置里边。  添加到key就行~ 4 配置完之后回到终端,输入ssh git@github.com验证一下ssh是否连接成功,这时候会出现
The authenticity of host 'github.com (13.229.188.59)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
后面输入yes,敲回车。出现
Hi Eenie-Meenie! You’ve successfully authenticated, but GitHub does not provide shell access.
这种即为ssh连接成功。 这一步的主要目的是生成一个known_hosts文件,否则会出现在SourceTree上输入ssh地址之后,一直在转圈验证地址的情况。 
3. 使用SourceTree拉取代码
打开SourceTree 点击新建,从URL克隆, 输入SSH地址,点击确定,即可从服务器拉取代码。 
 等待克隆代码就行~ 仓库代码大的话 会很慢~  源url: 仓库地址 直接用 gttp方式就行。 目标路径: 自己的本地目录
或者在终端中打开文件的命令是 open . 回车
至此就完成了实用SourceTree从服务器clone代码的操作,当然也可以使用SourceTree进行push, pull以及代码合并,等操作。
另外介绍一下三款好用的工具:
-
Tower Git Tower Git具有强大的Git资源库管理、版本控制、分支管理等等,已被很多知名公司使用,并且能够和Xcode、GitHub、Beanstalk、BBEdit等软件无缝结合使用 去官网下载就行~~~ -
SourceTree 支持Git版本控制的所有操作,如创建、克隆、提交、Push、Pull 和合并等操作 去官网下载就行~~~ -
Fork 具备Git的基本所有功能,支持快速打开最近的存储库,快速展示分支、来源标签等 去官网下载就行~~~
|