关于Xcode的.gitignore文件

因为之前电脑之间拷贝工程体积笔记大,删除了.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


我使用的.gitignore文件

# 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文件夹自己生成的


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值