What project files should be version controlled

During the initial version control section it was mentioned that the following list was to be version controlled, but for resetting the project the list was different. Should we keep the .vs folder and .sln file under version control?

List to be version controlled

.vs (deleted to reset)
Config
Content
Source
GameName.sln (deleted to reset)
GameName.uprojects

The .vs folder and solution file (.sln) doesn’t have to be version controlled, as they can be generated on the fly.

My .gitignore is:

# Unreal Engine
/*/Binaries/
/*/Build/
/*/DerivedDataCache/
/*/Intermediate/
/*/Saved/

# Starter Content
/*/Content/StarterContent/

# Visual Studio
/*/*.sln
/*/.vs/
/*/*.VC.db
/*/*.VC.VC.opendb

UE4 understands how to create .sln and .vs (and on Mac, the XCode equivalent files), so they don’t need to be source controlled. And it’s better if you don’t, because it can avoid situations where something is changed in the XCode or Visual Studio specific files but not in the uproject, which results in failed builds on other platforms.

1 Like

One if the other issues I had is with binary files being corrupted because of setting core.autocrlf in git. The fix for that is to explicitly specify which files should be text vs binary in .gitattributes:

# text files (full name)
.gitattributes                          text
.gitignore                              text

# text files (extension)
*.cpp                                   text
*.cs                                    text
*.h                                     text
*.ini                                   text
*.uproject                              text

# binary files (extension)
*.uasset                                binary
*.umap                                  binary
2 Likes

Privacy & Terms