一、共享版版本库建立:
1.搭建git服务器
真实的git服务器的搭建需要使用Linux来进行搭建,搭建难度大且繁琐
2.将代码托管Github:必须开源,不想开源需要交钱
3.或者OSChina:免费,推荐国内速度快
4.一个U盘可以为共享版本库
5.一个文件可以作为共享版本库
二、一个文件作为共享版本库


首先分别建如图的共享服务器和开发团队结构层次的文件夹。项目经理的文件夹代表经理的电脑。
-
初始化共享版本仓库
打开终端并 切换目录到项目中输入 git init --bare
屏幕快照 2018-01-03 上午11.58.34.png
通过发现子目录里没有.git文件,这就是共享与本地仓库的主要区别。
-
项目经理初始化项目
- 建一个本地仓库(将服务器完整的内容下载到本地 git clone 服务器地址)
终端输入命令:
cd /Users/reitaketachibana/Desktop/开发团队/项目经理
git clone /Users/reitaketachibana/Desktop/共享服务器/项目


执行得到项目经理就得到一个如图的本地仓库。
- 添加忽略文件(使用git需要忽略的一些文件)
a. 创建忽略文件
touch .gitignore
b .配置略文件
(1) github中拷贝需要忽略的内容(github搜 索.gitignore->找星最多的,点进去,找到object-c,打开复制;
(2)进入github(https://github.com),搜索.gitignore,回车;
(3)找到Object-C点进去;
(4)复制所有内容到.gitignore文件中;
git add .gitignore
commit -m "1111" .gitignore
3.使用xcode的初始化项目放到经理的工作目录中



-
我加入开发
cd /Users/reitaketachibana/Desktop/开发团队/我git clone /Users/reitaketachibana/Desktop/共享服务器/项目
得到:

网友评论