简体   繁体   English

我可以从我的git repo中“排除”哪些Xcode项目文件?

[英]Which Xcode project files can I 'exclude' from my git repo?

I'm working on an iOS project and am using git to do version control. 我正在开发一个iOS项目,我正在使用git来进行版本控制。 I'm working on this with another developer. 我正在与另一位开发人员合作。

Which Xcode project files should I keep in the repo and which ones can I exclude so that it doesn't affect the other developer negatively? 我应该在repo中保留哪些Xcode项目文件,哪些可以排除,以免对其他开发人员产生负面影响?

Here are some of the non-code files that git is telling me has been modified or added... (BTW, these are only viewable in the OSX file manager if you "Show Package Contents" for YourProject.xcodeproj file) 以下是git告诉我的一些非代码文件已被修改或添加...(顺便说一下,如果你为YourProject.xcodeproj文件“显示包内容”,这些只能在OSX文件管理器中查看)

exclude ? 排除?

  • contents.xcwordspacedata (I think this is just workspace settings) contents.xcwordspacedata(我认为这只是工作区设置)
  • UserInterfaceState.xcuserstate (based on the name it seems only specific to me) UserInterfaceState.xcuserstate(基于名称,它似乎只对我而言)
  • Breakpoints.xcbkptlist (...my breakpoints settings) Breakpoints.xcbkptlist(...我的断点设置)

INCLUDE ? 包括?

  • project.pbxproj (INCLUDE...project settings) project.pbxproj(INCLUDE ...项目设置)
  • *.xscheme (INCLUDE...scheme definitions) * .xscheme(INCLUDE ...方案定义)
  • xschememanagement.plist (INCLUDE...scheme manager settings?) xschememanagement.plist(INCLUDE ...计划管理器设置?)

Does this seem right? 这看起来是对的吗?

(Just an FYI for those that want to use the exclude feature of git. Edit your .git/info/exclude file in your local repository. Put in the files or the patterns for files that you want git to ignore. For example, if you want git to ignore foo.temp, bar.temp you can put a line in the file that says *.temp) (对于那些想要使用git的排除功能的人来说只是一个FYI。在你的本地存储库中编辑你的.git / info / exclude文件。输入你希望git忽略的文件的文件或模式。例如,如果你希望git忽略foo.temp,bar.temp你可以在文件中加上一行代表* .temp)

Think this is a great place to start Xcode .gitignore 认为这是启动Xcode .gitignore的好地方

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate

This one I modified Xcode .gitignore I believe it to be more comprehensive. 这个我修改了Xcode .gitignore,我相信它更全面。

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa

# 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-check-the-    pods-directory-into-source-control
#
#Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage    dependencies.
# Carthage/Checkouts

Carthage/Build

.DS_Store
.AppleDouble
.LSOverride

 # Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

The above adds CocoaPods, Carthage and some others that have shown up over time. 上面添加了CocoaPods,Carthage和其他一些随着时间的推移而出现的东西。

该站点 (www.gitignore.io)允许您指定IDE和/或语言,并向您显示定制的.gitignore - 很棒的站点!

You are definetely right about your includes, else you will be missing important information from your project file. 您对包含内容的定义是正确的,否则您将丢失项目文件中的重要信息。

For the excludes, I am myself excluding breakpoints and xcuserstate, but not xcworkspacedata, as I think it does store which projects are part of a workspace. 对于排除,我自己排除断点和xcuserstate,但不包括xcworkspacedata,因为我认为它确实存储哪些项目是工作空间的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM