Skip to main content

Unreal Engine 5 Source Control With Git

🚪 Prerequisite Knowledge

Understand about source control and how its works.

Git LFS is installed.

šŸ“Ž Git Large File Storage

ā“ Key Question / Problem / Issue

  1. How to use Source Control on Unreal Engine 5 Project?

āœ… Expected Output/Definition of Done

  1. Understand the source control flows and how to use it at Unreal Engine 5 project.

šŸŽ Resulting Solution

Source:

Source Control Inside Unreal Editor

GitHub - ProjectBorealis/UEGitPlugin: Unreal Engine Git Source Control Plugin (refactored)

Unreal Project Git Workflow (Tutorial) | Unreal Engine Community Wiki

Unreal Engine 5 Source Control

Version control allows users on your team to share assets and code with one another, as well as providing a backup and history of changes so any files can be rolled back to an earlier version if something went wrong with the file. Unreal assets (like .uasset or .umap) are binaries, it’s been complicated to resolve when the file update is conflict with another user, we should make sure the file is locked (check-out) when been edited by user. So, nobody can edit same binary files on a same times and unlocked (check-in) when user finished edit those files. Here’s a guide for workflow how Source control is works in Unreal Engine 5.

Unreal Engine 5 Source Control Installation

We use Git LFS 2 3rd party plugin (make sure git lfs is installed and add this .gitattributes to your project root folder), and because it’s not an official plugin that you can get at Unreal Engine Marketplace, we should add it to the project manually with create a Plugins/ folder, and extract this Source code Release 3.07 Ā· ProjectBorealis/UEGitPlugin Ā· GitHub, inside the folder.

Untitled

Or, you can clone this sample project.

Sign in

After the plugin is installed, open UE5 project.

Activate the source control plugin with click Source Control off > Connect to Source Control..

Untitled

Then select Git LFS 2 as a Provider.

Untitled

The popup contents would change, you just have to set the Input field next to Uses Git LFS (Its possibly filled by broken text) with your git Full Name.

  • Git Full Name Example

    Untitled

    Untitled

Untitled

If there’s additional input or button that contains initial commits, its possibly your UE plugin is not connected to source control or git status not tracked. Make sure you remote to the right repository, git is not error and git LFS is installed.

Source Control Icons Explanation

If source control is fully connected, you may seen various icon on top-right of the assets. Here is the icon shapes and its descriptions as you can see at the image below.

Untitled

Checking-out (Locking) Files

The main way to share content with collaborators is via theĀ Content Browser. All source control operations are accessible via the context menu for files and folders. For instance, toĀ Check Out Ā a file (i.e. lock it for editing),Ā Right-click on the asset and then select theĀ Check Out option.

Untitled

Optionally, you can set the editor to automatically check out files on save by enablingĀ Prompt for Checkout on Asset Modification. You can find these options by going toĀ Editor Preferences

Untitled

Click onĀ Loading & Saving scroll toĀ Source Control.

Untitled

When you edit asset, there’s pop a notification to check out these asset, if you click the Check-out link, then you will be presented with this dialog:

Untitled

Select one of the three button (check the descriptions of each button below)

Untitled

If you select Check Out Selected button, Icon would be added to your asset thumbnail

Untitled

And would be there till you push the asset (check-in).

Deleting files

If you delete any file, you would see the Delete Assets dialog. It will tell you the asset data, like name, class and refferences of the file you delete, it you sure to delete the files, select Force Delete button.

Untitled

You should submit the deleted files.

Untitled

Submitting Content to Source Control

Submitting to Source Control in Unreal Engine is a vital part of the Source Control process. If you do not submit anything to Source Control, other users will not be able to see what you have been working on or created. To submit all checked out asset, you can simply go to Source Control at the bottom-right of UE editor, and Submit Content.

Untitled

This will scan your project and the Engine for changes made to assets that can be submitted and then present you with theĀ Submit Files dialog. Fill the change list description (it will be a message commit) and Submit. Once you submit it, all of related assets (checked out or new file) and its checked would be committed and pushed to the repository.

Untitled

Additional Source Control Commands

When using right-click on a single (or multiple) file

  • Check Out Lock file(s) so other user can’t check-out, useful to prevent conflict. It’s advisable to Check Out file before editing/working on it.
  • Check In Submit (Commit & Push) selected file(s), also Unlock the file from Git-LFS
  • Sync Synchronize (Pull) selected file(s). If the file(s) is referenced by other files, the referencing files will be synchronized too.
  • Refresh Refresh the current file status/icon
  • History Show the changes made to this file. Right click on any history item to show popup menu to see changes between selected commit with previous commit or current working file
  • Diff Against Depot See side by side differences between current working file and last committed one.
  • Revert Discard changes and unlock file