Installing Git Source Control in Unreal Engine 5
🚪 Prerequisite Knowledge
Understand
- Unreal
sourceEnginecontrol5andFullyhowInstalleditswithworks.allit's development dependencies
📎 Unreal Engine 5 Installation
- Git LFS is installed.
📎 Git
Large File StorageLFS
❓ Key Question / Problem / Issue
- How to
useInstall & Setup Source Control on Unreal Engine 5 Project?
✅ Expected Output/Definition of Done
UnderstandReaderthe source control flows and howable tousesetupitGitatSource Control in Unreal Engine 5project.
🎁 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.
I Setting Up Unreal Engine 5 SourceGit ControlRepositories Installation(Initial Repositories)
To setup Unreal Engine Git Repositories you need to add these following files to the project root folder
- 🔗.gitattributes Template
- 🔗.gitignore Template
II Installing Git Plugin in Unreal Engine Project (Per-Project Setup)
We use Git LFS 2
3rd party pluginplugin, (makeUEGitPlugin surefrom gitProject lfsBorealis.
To installedInstall it Follow these steps:
-
Download Latest Relase Version of UE Git Plugin Here
-
Extract and
addplacethisthe.gitattributesplugintofolder inPlugins
folder of your projectrootfolder),andif
becauseyouit’sdon'tnotfindantheseofficialfolderplugincreatethatit yourselvesyou can
getalsoat Unreal Engine Marketplace, we should add itrefer tothethese sample projectmanuallyforwithreferencescreate aPlugins/folder, and extract this Source codeRelease 3.07 · ProjectBorealis/UEGitPlugin · GitHub, inside the folder.Or, you can clone this sample project.
III Activating Git Plugin (Per-Device Setup)
After Installing the plugin isyou installed,need opento UE5follow project.these step to activate Git Plugin Source Control
- Open Project.
- Activate the source control plugin with click Source Control off > Connect to Source Control..
- Then select Git LFS 2 as a Provider.
- 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.GitGateGit (GitLab) Full Name Example(Highlighted with red Underline)
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.
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.
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
Click on Loading & Saving scroll to Source Control.
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:
Select one of the three button (check the descriptions of each button below)
If you select Check Out Selected button, Icon would be added to your asset thumbnail
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.
You should submit the deleted files.
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.
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.
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