36
\$\begingroup\$

I want to put an Unreal Engine 4 project under source control with git. (I know the editor has Perforce and Subversion support, but I don't care for those.)

What folder and files do I include in the repository and which can I ignore?

The way I see it, the following is needed: Config, Content, Source, *.sln, *.uproject

Things that I can ignore: Binaries, DerivedDataCache, Intermediate, Saved, *.suo, *.sdf, *.opensdf

Is this correct?

\$\endgroup\$
4
  • 2
    \$\begingroup\$ If there's a .sln, there's usually a .vXX.suo file (which is invisible, usually) which you may want to ignore since it contains user-specific options. \$\endgroup\$
    – user1430
    Commented Mar 21, 2014 at 15:41
  • 2
    \$\begingroup\$ Github maintains a list of ignore files for various projects. There is no entry for Unreal4 yet. If you find the perfect list, perhaps you should submit a pull request to add it there. \$\endgroup\$ Commented Mar 21, 2014 at 17:28
  • \$\begingroup\$ I already ignored the VS temporary files, but thank you for making it obvious to everybody. I amended the question to reflect that. \$\endgroup\$
    – rioki
    Commented Mar 25, 2014 at 9:26
  • \$\begingroup\$ @rioki What's your impression about working with git? Yesterday was the firs time I worked with UE and saving the simple level used 500mb of my hard disk space. It's too much data for git to sync. \$\endgroup\$
    – user44748
    Commented Apr 18, 2014 at 9:32

3 Answers 3

23
\$\begingroup\$

I'm using GitHub for Windows which generates a nice gitignore ignoring most extraneous files like log files or files specific to VS that don't need to be shared.

From what I can gather from this page in the Unreal docs, you can probably ignore these directories:

DerivedDataCache
Intermediate
Saved

I'm not going to ignore Binaries, if only because I'm working with a level designer who doesn't have VS and so will need the DLL files I build (I assume, I could be wrong).

Again keep in mind I'm using Git for Windows that generates gitignore for you when you create a project, and it's pretty big. I'm pretty much only committing the following (where "ReallyCoolGame" is the name of your project):

.gitattributes
.gitignore
Binaries
Config
Content
Source
ReallyCoolGame.sln
ReallyCoolGame.uproject

I've only just committed this myself, and I've yet to test it with my level designer, so caveat emptor.

Also, I'm referring to a project created using the first-person C++ template, which gets saved to: E:\Documents\Unreal Projects\ReallyCoolGame (My Documents == E:\Documents on my machine) and not within the Unreal Engine source directory structure.

Edit: I also don't want to include all the default content, so I'm going to have a subdirectory within Content just for the game assets themselves with the same name as the project, and ignore all other subdirectories of Content. So the lines at the top of my .gitignore now look like:

DerivedDataCache
Intermediate
Saved
Content/*
!Content/ReallyCoolGame

And the level designer will put all of our assets in Content/ReallyCoolGame instead.

UPDATE:

The Intermediate directory actually contains Visual Studio's project files, which are needed to build the project. If the Intermediate directory is ignored, you won't be able to build the project because the Visual Studio solution won't find it. But there are two easy workarounds for this.

1) Just don't ignore the Intermediate directory. Of course in that case Visual Studio will still find all project files it needs and be able to build the project.

2) This one is even better, especially for version control: Open your project in Unreal Engine 4 editor and go to "File > Refresh Visual Studio Project". This will generate an all new solution file for you, which means you won't even need to commit it and can add the *.sln in the project folder to the .gitignore file.

Also *.suo and *.sdf files can be ignored in general, since Visual Studio just generates new ones when you open your solution.

\$\endgroup\$
1
  • \$\begingroup\$ I solved the issue with the default content differently. I did not add the starter content into the generated project. Building up the materials to get started is really a piece of cake and once it gets serious I will have my own assets. This removes something like 100 MB of files from the project. \$\endgroup\$
    – rioki
    Commented Mar 25, 2014 at 9:21
16
\$\begingroup\$

I don’t know the differences between the public version of UE4 and mine, but here is the .gitignore file I have been using:

Engine/Binaries/
Engine/DerivedDataCache/
Engine/Intermediate/
Engine/Plugins/*/*/Binaries/
Engine/Plugins/*/*/Intermediate/
Engine/Programs/UnrealHeaderTool/
Engine/Programs/UnrealPak/
Engine/Saved/
Engine/Shaders/Binaries/
Engine/Source/*/*/*/obj/
Engine/Source/*/*/obj/
Engine/Source/*/obj/

UE4.opensdf
UE4.sdf
UE4.sln
UE4.suo
UE4.*.suo

GameName/Binaries/
GameName/DerivedDataCache/
GameName/Intermediate/
GameName/Saved/
\$\endgroup\$
3
  • 1
    \$\begingroup\$ You have your game project withing the source three of the UE? If you have a custom build of the engine this may make sense, but I am using the stock engine. Basically I just need the GameName/* and VS ignores. \$\endgroup\$
    – rioki
    Commented Mar 25, 2014 at 9:24
  • \$\begingroup\$ Yes, the engine needs a lot of modifications, and upstream UE is regularly merged into the repository. \$\endgroup\$ Commented Mar 25, 2014 at 10:02
  • \$\begingroup\$ FWIW, when I was working with UE3 we also had our game project within the core UE source tree, and my impression was that this is SOP. I'll almost guarantee that you'll need to do engine mods as well, and it's much easier to keep track of everything if you consider UE+Your Game as a single 'entity'. \$\endgroup\$ Commented Apr 10, 2014 at 17:16
1
\$\begingroup\$

This is what I have in my .gitignore

#Unreal Engine
StarterContent/
Saved/
Binaries/
Build/
Debug/
Intermediate/
DerivedDataCache/
UnrealHeaderTool/
UnrealPak/
obj/
*.VC.opendb
*.opensdf
*.sdf
*.suo
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .