<声明:由于简书的要求如果文章中出现其他网站的地址,就不能发布到首页推荐或者其他专题,但是因为技术需要这些网站我觉得有必要写出来方便大家理解及使用,所以我仍然添了很多链接。当然我本人仍然很希望简书能将我的文章收录到首页推荐,只不过在技术介绍和推广两者之间选其一的话,我还是选择了前者,毕竟这才是我写这篇文章或者这才是我来简书这个地方的目的。希望大家多多支持。>
1.首先注册一个osChina的账号,注册界面如下,地址:https://git.oschina.net/signup。情况这里特别提下“个性地址”,这个地址可以用来直接登录osChina,非常方便,所以可以起一个方便记忆的名称。Email这一项非常重要!非常重要!非常重要!因为后面登陆Sourcetree的时候用的就是这个邮箱,千万不要错了。

2.创建一个空的项目

3.这里项目语言选择Objective-C,Gitlgnore选择Objective-C - .gitignore。选择私有项目。点击创建。<创建成功后就需要在mac上安装sourcetree>

4.安装sourcetree<太简单就不截图了>
5.在安装过程可以直接跳过配置信息,也可自己按照情况进行配置
6.重中之重--在安装的时候如果选择了跳过,那么在第一次操作会弹出一个提示框,要求你输入osChina的账号和密码,这个账号一定要填注册的邮箱账号。不然在你添加URL的时候他会让你一直输入密码——别问我怎么知道的,呵呵了。当然如果真的不小心填错了,那么把sourcetree删了,不方便删除的话就下载一个360,很方便删除。
具体步骤:
6.1.点击刚才创建的项目

复制链接

点击Sourcetree“+新仓库”->“从URL克隆”

将刚才复制的链接粘贴在“源URL”,点击下面的“目标路径”。如果刚才填写的是邮箱账号和密码,这里的“克隆”会变蓝。直接点击即可

整个过程如下:

7.蓝后呢,就点双击仓库

点击“工作副本”

点击“在Finder中打开”

把项目拖动到这个文件夹下

如果有“仓库”中的内容有改动,就会这样子。点击“未暂存文件”

点击“提交”。如果想对此次提交备注就可以写在框中。


不用管这个。如果想管,你仔细阅读下就知道了。

点击“拉取”——为了检查项目是否冲突,并获得最新项目版本。


点击“推送”,如果没有冲突,大功告成。

8.以上是个人使用Sourcetree在Git上托管项目。如果想要团队合作,那么要做如下操作。跟图操作就可以了
点击项目

点击“管理”

点击“项目成员管理”

点击“管理员”

点击“添加项目成员”,并设置管理权限

这个邮箱要注意填写他的注册osChina账号的邮箱。

完成!
其他的操作就参考步骤7.
<后记:由于使用Sourcetree拉取时候遇到的冲突没有写上去,后续再更新。希望及时关注。>
网友评论
抓取 是获取文件内容的更新内容