当Git与Xcode一起使用时,我应该在.gitignore中包含哪些文件?
当前回答
我们确实发现,即使你添加。gitignore和。gittribte *。Pbxproj文件可能被损坏。所以我们有一个简单的计划。
在办公室编码的每个人都简单地丢弃了对这个文件所做的更改。在提交中,我们简单地提到了添加到源代码中的文件。然后推送到服务器。我们的集成管理器会查看提交细节,并将文件添加到资源中。
一旦他更新了远程,每个人都会有一个工作副本。如果少了什么,我们会通知他把它加进去,然后再拉一次。
这对我们来说没有任何问题。
其他回答
以下是GitHub默认用于新Xcode存储库的.gitignore:
https://github.com/github/gitignore/blob/master/Objective-C.gitignore
它可能在任何给定的时间都是合理正确的。
我使用以下在gitignore.io中生成的.gitignore文件:
### Xcode ###
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate
### Objective-C ###
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
Pods/
Xcode项目>的标准。gitignore文件的结构
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
gitignore。io:为你的项目创建有用的gitignore文件
Example: Preview | Edit Programming Languages: Objective-C Swift Build Automation Tool: SwiftPackageManager Carthage IDEs: Xcode Operating Systems: macOS Steps to use in Terminal (Refer to the YouTube Video) Create Git global config alias (One time only) git config --global alias.ignore '!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi' Enter the project directory cd <the project directory> Generate .gitignore file git ignore Objective-C,Swift,SwiftPackageManager,Carthage,Xcode,macOS >.gitignore Add and commit .gitignore file git add .gitignore git commit -m "Add .gitignore file"
基于Mercurial的这个指南,我的.gitignore包括:
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3
我还选择了包括:
*.mode1v3
*.mode2v3
根据苹果邮件列表,这是“用户特定的项目设置”。
对于Xcode 4:
xcuserdata
推荐文章
- 在成功提交我的应用程序后,“太多符号文件”
- 复制并重命名Xcode项目和相关文件夹
- 在Bash命令提示符上添加git分支
- 如何更改Git日志日期格式
- 如何从macOS完全卸载蟒蛇
- git pull -rebase和git pull -ff-only之间的区别
- GitHub -致命:无法读取用户名https://github.com':没有这样的文件或目录
- 撤消git平分错误
- 使用.gitconfig配置diff工具
- Xcode 4挂在“附加到(应用程序名称)”
- 为什么单元测试中的代码不能找到包资源?
- 如何配置Mac OS X术语,使git有颜色?
- Visual Studio Code: .git文件夹/文件隐藏
- “node_modules”文件夹应该包含在git存储库中吗
- 为什么git-rebase给了我合并冲突,而我所做的只是压缩提交?