Git忽略Xcode 4项目的文件

时间:2022-02-26 14:03:29

Which files are better to ignore in git for an Xcode 4(.3.2)? This older question addresses the same issue but I find my structure to be different so I assume it's about an older version of Xcode.

对于Xcode 4(.3.2),哪些文件最好在git中忽略?这个较旧的问题解决了同样的问题,但我发现我的结构不同,所以我认为它是关于旧版本的Xcode。

5 个解决方案

#1


18  

Here are git ignore files for basicly every language including Xcode : Github - git ignore

以下是git ignore文件,基本上是每种语言,包括Xcode: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

#2


11  

This is what we use:

这就是我们使用的:

#xcode Noise
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata

# OSX Noise
.DS_Store
profile
*~
*.lock
*.DS_Store
*.swp
*.out

#3


5  

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来管理库的人留言。除了CocoaPods生成的xcworkspace之外,你还应该忽略Pods /目录:

Pods/*

every developer should do pod install on their own machine separately. otherwise, they may face many environment issues.

每个开发人员都应该分别在自己的机器上进行pod安装。否则,他们可能面临许多环境问题。

#4


2  

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

#5


0  

I normally ignore the following

我通常忽略以下内容

  • /ProjectPath/project.xcodeproj/xcuserdata
  • /ProjectPath/project.xcodeproj/xcuserdata
  • /ProjectPath/project.xcodeproj/project.xcworkspace
  • /ProjectPath/project.xcodeproj/project.xcworkspace

And some hidden files like

还有一些隐藏文件

  • /ProjectPath/.DS_Store
  • /ProjectPath/.DS_Store

#1


18  

Here are git ignore files for basicly every language including Xcode : Github - git ignore

以下是git ignore文件,基本上是每种语言,包括Xcode: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

#2


11  

This is what we use:

这就是我们使用的:

#xcode Noise
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata

# OSX Noise
.DS_Store
profile
*~
*.lock
*.DS_Store
*.swp
*.out

#3


5  

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来管理库的人留言。除了CocoaPods生成的xcworkspace之外,你还应该忽略Pods /目录:

Pods/*

every developer should do pod install on their own machine separately. otherwise, they may face many environment issues.

每个开发人员都应该分别在自己的机器上进行pod安装。否则,他们可能面临许多环境问题。

#4


2  

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

#5


0  

I normally ignore the following

我通常忽略以下内容

  • /ProjectPath/project.xcodeproj/xcuserdata
  • /ProjectPath/project.xcodeproj/xcuserdata
  • /ProjectPath/project.xcodeproj/project.xcworkspace
  • /ProjectPath/project.xcodeproj/project.xcworkspace

And some hidden files like

还有一些隐藏文件

  • /ProjectPath/.DS_Store
  • /ProjectPath/.DS_Store