因为之前电脑之间拷贝工程体积笔记大,删除了.git目录,现在使用git init命令新建git支持,通过git add .命令会把所有文件都添加进git备份里,包括了临时文件中间文件,会影响后续的commit和pull,最后看了《Pro Git》发现可以写.gitignore文件来排除多余文件,stackoverflow上有一个回答,记录在下:
1)
The easiest answer is that mine looks like this:
# Xcode
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
# Pods - for those of you who use CocoaPods
Pods
which I believe is the same .gitignore that GitHub sets up with all their repositories by default.
2)
Another answer is that there's a website called "gitignore.io" , which generates the files based on the .gitignore templates from https://github.com/github/gitignore.
原文链接:http://stackoverflow.com/questions/18939421/what-should-xcode-6-gitignore-file-include
# Created by https://www.gitignore.io
### Xcode ###
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate
相比较只是增加了.DS_Store,这个是Mac文件夹自己生成的