How to setup Git project with Unreal

What is the best way to clone ue4 and start a new github project based on it? Right now I have both projects (UE4 and My Game) in two different directories, and managed with 2 different Source Control Repositories.

Engine: C:\Users\\Documents\Dev\Game\UnrealEngine
Game: C:\Users\\Documents\Dev\Game\MyGame

The problem with this is that if someone else wants to clone my project, they need to know what version of unreal to clone, and make sure the two projects are relative to each other in the same way I did it.

Is there a better way to set this up? A way where by cloning my project it automatically clones the proper revision of Unreal? I’m new to Git, so apologies if this is obvious stuff!


Have you considered having the engine as a submodule (Git - Submodules)?

Hi mhughson,

There are a few options for you to make this work. The first is what you are currently doing. This will allow you to make edits to either your Engine or project independently of each other. However, as you noted, it makes it a little more difficult for others to be sure that they have the Engine and project in sync with each other.

Another option is to make everything in your Game folder into a single repository that includes both the Engine and the project. This would ensure that any other users only have a single repository to sync to. This should work fine for most cases, but is a bit of a clunky solution.

Finally, the option that we use internally for projects, would be to include the game project in the Engine directory and make sure your .uprojectdirs file includes it. In most cases this involves creating a new Games folder in the root Engine directory (so in your example it would be C:\Users\\Documents\Dev\Game\UnrealEngine\Games) and then creating your game project inside that folder. You would then open the UE4Games.uprojectdirs file that is included with the Engine source code (since 4.6) in a text editor and add a new line containing Games/, then save and close the file. Run GenerateProjectFiles.bat for the Engine, and now the code for your project will be included in the UE4.sln, and you will only use that solution file in Visual Studio regardless of whether you are working on the Engine or your project. The real benefit here is that you can easily add new projects that use your version of the Engine, and there is only a single repository for all of the projects as well as the Engine.