版本控制下的 xcodeproj

发布于 2024-10-11 21:15:38 字数 35 浏览 3 评论 0原文

将 Xcode 项目纳入版本控制之下时的最佳实践是什么?

What are the best practices while including a Xcode project under version control.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

舞袖。长 2024-10-18 21:15:38

这就是我的全球中的内容。 gitignore 文件,您可以在 GitHub 上将其视为 gist,但可以应用 Xcode 列表到其他系统

# Mac OS X
*.DS_Store

# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/

# Generated files
*.o
*.pyc

#Python modules
MANIFEST
dist/
build/

# Backup files
*~.nib
\#*#
.#*

This is what is in my Global .gitignore file which you can see as a gist on GitHub, but the Xcode list can be applied to other systems

# Mac OS X
*.DS_Store

# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/

# Generated files
*.o
*.pyc

#Python modules
MANIFEST
dist/
build/

# Backup files
*~.nib
\#*#
.#*
救星 2024-10-18 21:15:38

检查project.pbxproj,忽略用户特定文件。

使用子模块/外部文件/VCS 支持的任何内容包含共享组件和第三方库作为项目依赖项,而不是手动复制没有任何历史记录的静态库二进制文件。

您将在 project.pbxproj 中遇到合并冲突,准备好处理此问题并尽量减少解决它们的难度。

  • 对于文件在磁盘上的位置以及如何映射到 Xcode 中的组,具有一致的结构。
  • 对构建目标中包含的资源以及项目组中资源的顺序进行排序。我确实需要编写一个脚本来为我执行此操作,因为当您不必比较两个随机文件集时,识别合并冲突的原因要容易得多。它还避免了许多合并冲突,因为您不太可能让多个开发人员都将新资源附加到列表底部。

尽早且经常入住。

Check in project.pbxproj, ignore the user specific files.

Include shared components and third party libraries as project dependencies using submodules/externals/whatever your VCS supports instead of manually copying static library binaries without any history.

You will get merge conflicts in the project.pbxproj, be prepared to deal with this and try to minimize the difficulty of resolving them.

  • Have a consistent structure for where files should be on disk and how that maps to groups in Xcode.
  • Sort the resources included in your build targets and the order of resources within your project's groups. I really need to write a script to do this for me because it is so much easier to identify the cause of a merge conflict when you don't have to diff two random sets of files. It also avoids many merge conflicts as you're less likely to have multiple developers all appending new resources to the bottom of a list.

Check in early and often.

醉殇 2024-10-18 21:15:38

在我的项目中,我在版本控制中有 Project.xcodeproj/project.pbxproj ,并省略了 User.mode1v3User.pbxuser 文件。

project.pbxproj 似乎保存了项目的元数据,例如文件所在的位置以及构建设置是什么。

用户文件将包含打开哪些文件、光标在哪里等信息。

您还可以参考 这个问题询问一些人选择忽略哪些文件。

In my project I have Project.xcodeproj/project.pbxproj in version control and leave out the User.mode1v3 and User.pbxuser files.

project.pbxproj seems to hold the metadata for the project, such as where the files are located and what the build settings are.

The user files would have things like what files are opened, where the cursor is, etc.

You can also refer to THIS question for what files some people have chosen to ignore.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文