Git 忽略 Xcode 4 项目的文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11177443/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git ignore file for Xcode 4 projects
提问by ticofab
采纳答案by Pfitz
Here are git ignore files for basicly every language including Xcode : Github - git ignore
以下是包括 Xcode 在内的几乎所有语言的 git ignore 文件:Github - git ignore
For me it is working like a charm. Here is the content of the Objective-C.gitignore
对我来说,它就像一种魅力。这是Objective-C.gitignore的内容
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
回答by Cliff Ribaudo
This is what we use:
这是我们使用的:
#xcode Noise
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata
# OSX Noise
.DS_Store
profile
*~
*.lock
*.DS_Store
*.swp
*.out
回答by Brian
Existing answers are good. I just want to leave a note for people who are using CocoaPods
to manage libraries. Besides the xcworkspace
generated by CocoaPods, you should also ignore Pods/
directory:
现有的答案很好。我只想给正在使用CocoaPods
管理图书馆的人留下一个笔记。除了xcworkspace
CocoaPods 生成的,你还应该忽略Pods/
目录:
Pods/*
every developer should do pod install
on their own machine separately. otherwise, they may face many environment issues.
每个开发人员都应该pod install
在自己的机器上单独进行。否则,他们可能会面临许多环境问题。
回答by gregoltsov
I've been using the solution from the question you linked with a few changes. I think it has a really nice solution for ignoring unnecessary project files
我一直在使用您链接的问题中的解决方案,并进行了一些更改。我认为它有一个非常好的解决方案来忽略不必要的项目文件
#OS junk files
[Tt]humbs.db
*.DS_Store
*.bak*
#Xcode files
#This ignores everything inside a *.xcodeproj except the project.pbxproj
*.xcodeproj/
!*.xcodeproj/project.pbxproj
*.log
xcuserdata
#Project files
[Bb]uild/
#Version control files
.svn
*.orig
回答by Omar Abdelhafith
I normally ignore the following
我通常会忽略以下内容
- /ProjectPath/project.xcodeproj/xcuserdata
- /ProjectPath/project.xcodeproj/project.xcworkspace
- /ProjectPath/project.xcodeproj/xcuserdata
- /ProjectPath/project.xcodeproj/project.xcworkspace
And some hidden files like
还有一些隐藏文件,比如
- /ProjectPath/.DS_Store
- /ProjectPath/.DS_Store