创建一个空的文件夹。(个人创建在了桌面,名字为gitTest)
cd /Users/apple/Desktop/gitTest
把项目工程的git URL得到
WiKideMacBook-Air:gitTest WiKi$ git clone git@git.oschina.net:suwenkang/onlyText.git
WiKideMacBook-Air:gitTest WiKi$ cd onlyText/
WiKideMacBook-Air:onlyText WiKi$ ls -la
total 16
drwxr-xr-x 5 WiKi staff 170 12 10 13:00 .
drwxr-xr-x 3 WiKi staff 102 12 10 13:00 ..
drwxr-xr-x 13 WiKi staff 442 12 10 13:00 .git
-rw-r--r-- 1 WiKi staff 1073 12 10 13:00 LICENSE
-rw-r--r-- 1 WiKi staff 11 12 10 13:00 README.md
将gitignore保存gitTest文件下,
p /Users/apple/Desktop/gitignore-master/Swift.gitignore .gitignore
WiKideMacBook-Air:onlyText WiKi$ ls -la
total 24
drwxr-xr-x 6 WiKi staff 204 12 10 13:06 .
drwxr-xr-x 3 WiKi staff 102 12 10 13:00 ..
drwxr-xr-x 13 WiKi staff 442 12 10 13:00 .git
-rwxr-xr-x@ 1 WiKi staff 1319 12 10 13:06 .gitignore
-rw-r--r-- 1 WiKi staff 1073 12 10 13:00 LICENSE
-rw-r--r-- 1 WiKi staff 11 12 10 13:00 README.md
把gitignore保存在git上。
git status
git add .
git status
git commit -m "添加gitignore"