使用 git 开发 iPhone 应用程序。哪些文件不能共享?
我正在和朋友一起开发 iPhone 应用程序。我们正在与 git 共享代码,但我们面临一些问题,例如,当一个添加一些新文件(git add、git commit、git push)时,另一个在 xcode 中看不到它们,需要从文件系统复制它们。
在源代码之上要共享哪些文件?
哪些文件不能共享(我正在考虑链接到 xcodeproj、xcuserdata 等的文件)?
I'm developing iphone apps with a friends. We are sharing the code with git but we are facing some problems for instance when one add some new file (git add, git commit, git push) the other one can not see them in xcode and needs to copy them from filesystem.
What are the file to share on top of the source code ?
What are the file not to share (I'm thinking of files linked to xcodeproj, xcuserdata, ...) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 .gitignore 文件应如下所示:
项目文件夹中包含的所有其他内容(源代码、资源等)都可以而且应该共享。所以,是的,请共享
xxx.xcodeproj
- 甚至xxx.xcworkspace
- 文件夹,否则您的同事将无法获得项目的更新版本,可能包括新文件建造。起草的 .gitignore 将阻止共享 .DS_Store、构建结果、Xcode 3.x 用户特定工作区设置和 Xcode 4.x 用户特定工作区设置。
正如 Tamas 所提到的,您实际上可以从 这个答案 复制 Mercurial 模式并通过上面起草的
xcuserdata/
对其进行增强,以将其更新为 Xcode 4.x 兼容模式。Your
.gitignore
file should look somewhat like this:Everything else contained in your project folder (sources, resources, etc...) can and should be shared. So yes, do share the
xxx.xcodeproj
- or evenxxx.xcworkspace
- folder or else your coworkers won't get updated versions of your project, possibly including new files to build.The drafted .gitignore will prevent sharing of the .DS_Store, build-results, Xcode 3.x user-specific workspace settings and the Xcode 4.x user-specific workspace settings.
As mentioned by Tamas, you may actually just copy the mercurial pattern from this answer and enhance it by
xcuserdata/
as drafted above to update it towards an Xcode 4.x compatible pattern.