我正在开发一个iOS项目,并使用git进行版本控制.我正在与另一位开发人员合作.
我应该保留哪些Xcode项目文件在repo中,哪些可以排除,这样不会对其他开发者产生负面影响?
这里有一些非代码文件,git告诉我已被修改或添加…
(BTW,这些仅在OSX文件管理器中可见,如果您的“Pro Package.xcodeproj”的“显示包内容”)
排除?
> content.xcwordspacedata(我认为这只是工作区设置)
> UserInterfaceState.xcuserstate(根据名字看起来只是我特有的)
> Breakpoints.xcbkptlist(…我的断点设置)
包括?
> project.pbxproj(INCLUDE …项目设置)
> * .xscheme(INCLUDE …方案定义)
> xschememanagement.plist(INCLUDE …方案管理器设置?)
这是否正确?
(只是希望使用git的排除功能的用户的FYI)在本地存储库中编辑您的.git / info / exclude文件放入要git忽略的文件的文件或模式,例如,如果你想要git忽略foo.temp,bar.temp,你可以在文件中放一行* .temp)
解决方法
认为这是开始
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
这个我修改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