版本控制
Version Control Systems or VCS (Git, SVN, Perforce, Mercurial, Bazaar, CVS, TFS, etc.) are used to manage changes to code and data, and enable teams to coordinate their development efforts. To make tracking of changes efficient and reduce the amount of disk space required, you should know which files must be tracked by the VCS and which can be ignored.版本控制系统或VCS(Git, SVN, Perforce, Mercurial, Bazaar, CVS, TFS 等)用于管理代码和数据的更改,并使团队能够协调他们的开发工作。 要使更改的跟踪变得高效并减少所需的磁盘空间量,您应该知道VCS必须跟踪哪些文件,哪些文件可以忽略。
Ignore List忽略列表#
In any project there are files and folders that are not subject to version control. These can be files created by the compiler, *.obj, *.tlog, or an output folder used to store binary executables.在任何项目中,都有不受版本控制的文件和文件夹。 这些文件可以是由编译器创建的文件、*.obj、*.tlog或用于存储二进制可执行文件的输出文件夹。
The following files and folders in you project's root can be ignored, as they are generated automatically on your disk:项目根目录中的以下文件和文件夹可以忽略,因为它们是在磁盘上自动生成的:
Common ignore list for every API and IDE每个API和IDE的通用忽略列表#
- .thumbnails
- bin
Add this folder to version control before updating the engine’s version or reconfiguring the project in SDK Browser to provide the updated bin to all developers. 在更新引擎版本或在 SDK 浏览器中重新配置项目之前,将此文件夹添加到版本控制中,以便向所有开发人员提供更新的 bin。
- data/.thumbnails
- data/microprofile_dump_html
- junk
- obj
- source/x64
- CMakeCache.txt
- source/**/*.obj
- unigine_editor.cfg
- *.cache
- *.modified
- *.tlog
.thumbnails
bin
data/.thumbnails
data/microprofile_dump_html
junk
obj
source/x64
CMakeCache.txt
source/**/*.obj
unigine_editor.cfg
*.cache
*.modified
*.tlog
Additional ignore list for C++ (CMake) projectsC++(CMake)项目的附加忽略列表#
Add these entries to the common .gitignore specified above when developing projects based on C++ (CMake).在基于 C++ (CMake) 开发项目时,将这些条目添加到上面指定的通用 .gitignore中。
- build-*
- CMakeFiles
- CMakeScripts
- CMakeCache.txt
- cmake_install.cmake
- CMakeUserPresets.json
- compile_commands.json
- CTestTestfile.cmake
build-*
CMakeFiles
CMakeScripts
CMakeCache.txt
cmake_install.cmake
CMakeUserPresets.json
compile_commands.json
CTestTestfile.cmake
Additional ignore list for C++ (Visual Studio 2015+) projectsC++(Visual Studio2015+)项目的附加忽略列表#
Add these entries to the common .gitignore specified above when developing projects based on C++ (Visual Studio 2015+).在开发基于 C++ (Visual Studio2015+) 的项目时,将这些条目添加到上面指定的通用 .gitignore 中。
- .vs
- *.vcxproj.user
- *.VC.db
- *.opendb
- *.opensdf
- *.pro.user
- *.sdf
- *.suo
.vs
*.vcxproj.user
*.VC.db
*.opendb
*.opensdf
*.pro.user
*.sdf
*.suo
Files and Folders to Add to Version Control要添加到版本控制的文件和文件夹#
The following files and folders should be subject to version control:以下文件和文件夹应受版本控制:
data folder with all its contentsdata文件夹及其所有内容
If you do not want to share the editor and application settings with other team members, add the following configuration files to .gitignore:如果您不想与其他团队成员共享编辑器和应用程序设置,请将以下配置文件添加到 .gitignore:
- data/configs/unigine.user
- data/configs/default.user
- data/.editor2/*
This folder also contains runtime files (data/.runtimes) that should be committed. However, if you occasionally fail to commit runtimes, the runtimes validation process will run when UNIGINE Editor is started, and the missing/outdated runtimes are added/updated. The runtime validation is also performed on adding a new mount.此文件夹还包含应提交的运行时文件(data/.runtimes)。 但是,如果您偶尔未能提交运行时,运行时验证过程将在UNIGINE编辑器启动时运行,并且添加或更新所有丢失或过时的运行时。 运行时验证也会在添加新挂载时执行。
-
source folder contents except for the elements mentioned abovesource 文件夹内容除了上面提到的元素
This folder is created only for projects that use C++ or C# API.此文件夹仅为使用C++或C#API的项目创建。 -
*.cache files containing compiled shader cache包含编译着色器缓存的*.cache 文件
When team members develop a project using different GPUs or/and driver’s version for their machine configuration, it is better to add the shader cache files to .gitignore since these file will be recompiled by an end developer’s computer.当团队成员为其计算机配置使用不同的Gpu或/和驱动程序版本开发项目时,最好将着色器缓存文件添加到 .gitignore,因为这些文件将由最终开发人员的计算机重新编译。 - *.project file (and *.csproj for C# projects)*.project 文件(和C#项目的 *.csproj)
Other Notices其他通告#
This chapter contains recommendations based on the user experience.本章包含基于用户体验的建议。
PerforcePerforce#
- Set the Allwrite attribute in Perforce Workspace (the Advanced tab). It's disabled by default, which may cause issues with SDK Browser and *.project file.在 Perforce Workspace(Advanced 选项卡)中设置 Allwrite 属性。默认情况下,该属性处于禁用状态,这可能会导致 SDK 浏览器和 *.project 文件出现问题。
- Checking out and locking a file does not prevent other users from modifying it, since that's only a Perforce abstraction.检出和锁定文件不会阻止其他用户修改它,因为这只是一个Perforce抽象。