在Unity 3D中使用Git源代码控制的最佳实践是什么,特别是在处理Unity 3D项目的二进制性质时?请描述工作流程,在.gitignore中包含哪些路径,应该在Unity和/或项目中设置什么设置,以及任何其他应该注意的特殊事情。
注意:我知道使用资产服务器是unity推荐的方式,但出于各种原因,我想使用Git。请不要回答,状态或争论,我应该只是使用资产服务器。资产服务器真的不是我的选择。
在Unity 3D中使用Git源代码控制的最佳实践是什么,特别是在处理Unity 3D项目的二进制性质时?请描述工作流程,在.gitignore中包含哪些路径,应该在Unity和/或项目中设置什么设置,以及任何其他应该注意的特殊事情。
注意:我知道使用资产服务器是unity推荐的方式,但出于各种原因,我想使用Git。请不要回答,状态或争论,我应该只是使用资产服务器。资产服务器真的不是我的选择。
当前回答
只是补充一下吉提诺的主题。 推荐的方法只忽略Library和Temp,如果它在你的git项目的根目录内。如果你像我一样,有时需要统一项目成为回购的一部分,而不是整个回购,gitignore中正确的字符串将是:
**/[Tt]emp
**/[Ll]ibrary
**/[Bb]uild
其他回答
只是补充一下吉提诺的主题。 推荐的方法只忽略Library和Temp,如果它在你的git项目的根目录内。如果你像我一样,有时需要统一项目成为回购的一部分,而不是整个回购,gitignore中正确的字符串将是:
**/[Tt]emp
**/[Ll]ibrary
**/[Bb]uild
我想我可以发布一个更简单的。gitignore给感兴趣的人:
# Ignore Everything
/*
# Except for these
!/.gitignore
!/Assets
!/Packages
!/ProjectSettings
I suggest that you make a .gitignore file that includes everything other than the assets folder (all the other files that are originally inside a unity project). Next, you should place all your game projects in one folder. Next, duplicate the .gitignore in every single project folder for your games. This will exclude the libraries and unnecessary folders inside your projects other than the assets. If you have any projects you don't want, then put them in a new .gitignore inside where your game projects are stored. Note: You can have multiple .gitignore's and .gitignore is based on relative paths. I hope that helped!
我强烈建议你切换到PlasticSCM。 这是Unity所迁移的内容,并提供了设计师和开发者工作流来管理游戏开发等复杂内容的版本控制。
3个用户可以免费获得云版。它取代了Unity的协作工具。
注意:我使用Git/Bitbucket和SourceTree来管理一个简单的项目真的很困难。
https://unity.com/products/plastic-scm
只有Assets和ProjectSettings文件夹需要置于git版本控制之下。
你可以做一个这样的gitignore。
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
*.suo
*.userprefs
# Mac
.DS_Store
*.swp
*.swo
Thumbs.db
Thumbs.db.meta
.vs/