Setting up a UE4 Project for Version Control with Git

 · 1 min read

Project Setup with Git

  1. Create an Unreal C++ Project (instead of BluePrint): it’s easier to extend a C++-based project with blueprint than the other way around. We will use the newly created project folder as the repository root. That way, you can rename the project folder without affecting the way Git sees it (e.g. .gitignore paths).
  2. Prepare it as the Git repository:
    1. Initialize Unreal project folder locally as git repo (can be done via Unreal directly, but manual gives more control regarding initial commit, .gitignore, etc., whereas Unreal directly commits some project files.).
    2. Add .gitignore (use custom .gitignore (preferred) or the .gitignore created by Unreal Engine).
    3. Commit the .gitignore file.
    4. Set up LFS for large binary files:
      1. Initialize Git LFS.
      2. Add a .gitattributes.
      3. Commit the .gitattributes file.
  3. Commit the Unreal Project files (track binary files with LFS).
  4. Initialize Git-Flow or create a “develop” branch manually.
  5. Create a plain remote repository (no initial commit) on GitHub or other provider.
  6. Add remote repository as a remote in local Git (connecting the two) and push.

Tips for working with the project:

Using Unity Smart Merge tool