The key is to configure Git LFS before you add any large files to your repository . You can do this entirely from your Git CMD terminal.
1. Install and Configure Git LFS
First, ensure Git LFS is installed. The good news is that Git LFS is included in the standard Git for Windows distribution .
Open Git CMD.
Navigate to your UE5 project folder.
You also check to see if Git LFS is installed when you open your Git CMD and run this command
git lfs install
If it runs without an error (e.g., "Git LFS initialized"): Great, you have Git LFS! You can move to the next step.
If it gives an error like "git: 'lfs' is not a git command": It's not included with your Git installation. You will then need to install it separately. You can download the installer from the Git LFS website.
2. Navigate to Your Project Folder
Open Git CMD and navigate to your project directory:
bash
cd /d E:\Stuff\Unreal\DemoProject
3. Set Up Git LFS for UE5 File Types
Run this command to tell Git LFS which file types to manage:
bash
git lfs track "*.uasset" "*.umap" "*.fbx" "*.png" "*.wav" "*.mp4" "*.psd"
This will create a .gitattributes file. This is the most important step – without it, your large asset files will hit GitHub's 100 MB limit and the push will fail.
If you get the error “Not in a Git repository” it means Git hasn't been initialized in your project folder yet. Git LFS commands like git lfs track need to be run inside a Git repository, so you need to run git init first.
Follow these steps in order:
4. Initialize Git Repository
In Git CMD, navigate to your project folder (you're already there) and run:
bash
git init
You should see a message like:
text
Initialized empty Git repository in E:/Stuff/Unreal/DemoProject/.git/
5. Now Run the Git LFS Track Command
Now that Git is initialized, run the Git LFS track command:
bash
git lfs track "*.uasset" "*.umap" "*.fbx" "*.png" "*.wav" "*.mp4" "*.psd"
You should see output like:
text
Tracking "*.uasset"
Tracking "*.umap"
Tracking "*.fbx"
Tracking "*.png"
Tracking "*.wav"
Tracking "*.mp4"
Tracking "*.psd"
This creates/updates the .gitattributes file.
6. Verify Git LFS Tracking
Check that the file types are being tracked:
bash
git lfs track
You should see a list of the patterns you just added.
7. Create .gitignore File
Create a .gitignore file in your E:\Stuff\Unreal\DemoProject folder with the UE5-specific ignore patterns I provided earlier. You can create this in Notepad or any text editor.
Copy and paste this content:
text
Binaries/
Intermediate/
Saved/
DerivedDataCache/
.vs/
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb
*.xcodeproj
*.xcworkspace
Launch/
.ipch/
.idea/
*.swp
*.tmp
*.temp
*.log
*.pdb
*.pdb.meta
*.exp
*.lib
*.ilk
*.obj
*.pch
*.dll
*.dylib
*.so
*.pdb
*.exe
*.app
*.pyc
*.pyo
*.pidb
*.user
*.userprefs
*.sln.docstates
*.sln.ide
Build/
*.vsconfig
*.vsindex
*.vsp
*.vsmdi
*.testsettings
*.dbmdl
*.css.map
*.js.map
*.min.js
*.min.css
8. Commit the Config Files First
bash
git add .gitattributes .gitignore
git commit -m "Initial commit: Set up Git LFS and .gitignore"
If you get E:\Stuff\Unreal\DemoProject>git add .gitattributes .gitignore fatal: pathspec '.gitignore' did not match any files
This error means the .gitignore file doesn't exist in your project folder yet. You need to create it first. It is possible that the file is listed as a "Text Document" with the extension .gitignore — which is correct. But Git might still not recognize it if it has a .txt extension. Verify and fix if needed.
9. Verify the File Extension
In your Git CMD, run:
bash
dir
Look for .gitignore in the list. If you see:
.gitignore — Perfect, you're good to go!
.gitignore.txt — You need to rename it.
10. Rename the File
Run this command in Git CMD:
bash
ren .gitignore.txt .gitignore
Now verify it worked:
bash
dir
You should now see .gitignore (without the .txt extension).
11. Now Run the Git Commands
bash
git add .gitattributes .gitignore
bash
git commit -m "Initial commit: Set up Git LFS and .gitignore"
If you get the error
Author identity unknown *** Please tell me who you are.
The error is resulting because Git needs to know who you are to label your commits. Here's how to fix it.
12. Set Your Git User Identity
In Git CMD, type these two commands (replace with your actual name and email):
bash
git config --global user.name "Your Name"
bash
git config --global user.email "your-email@example.com"
For example:
bash
git config --global user.name "Don Charles"
bash
git config --global user.email "don@impulseresponseenterprises.cc"
13. Verify It's Set Correctly
bash
git config --global user.name
You should see the name you put in.
bash
git config --global user.email
You should see the email you put in.
14. Now Rerun the Commit Command
bash
git commit -m "Initial commit: Set up Git LFS and .gitignore"
This should now work. You'll see output like:
text
[main (root-commit) a1b2c3d] Initial commit: Set up Git LFS and .gitignore
2 files changed, 10 insertions(+)
create mode 100644 .gitattributes
create mode 100644 .gitignore
15. Then Continue with the Rest
bash
git add .
bash
git commit -m "Add Unreal Engine 5 project files"
16. Next Steps to Push to GitHub
Next, you need to go to GitHub. Login, and go to your profile page. Then create a new repository. That is because you need an empty repository on GitHub to push to.
Click the green "New" button or the "+" icon in the top-right corner and select "New repository".
Name your repository (for example, DemoProject).
Important: Do not initialize it with a README, .gitignore, or license, since you already have these locally.
Click "Create repository".
17. Connect Your Local Repo to GitHub
Once your new, empty repository is created, GitHub will show you a quick setup page. In your Git CMD, run the command to add the remote. Copy the line that looks like this and paste it into your Git CMD:
bash
git remote add origin https://github.com/yourgitaccount/DemoProject.git
(Make sure the repository name matches the one you just created on GitHub)
18. Next Step: Push to GitHub
Run this command in Git CMD:
bash
git push -u origin main
19. What Will Happen Next
Since this is your first time pushing to GitHub from this computer, you'll likely see a browser window pop up asking you to sign in to GitHub.
Sign in as yourgitaccount
Click "Authorize" or "Confirm" to allow Git to access your repositories
If get E:\Stuff\Unreal\DemoProject>git push -u origin main error: src refspec main does not match any error: failed to push some refs to 'https://github.com/yourgitaccount/DemoProject.git'
This error means your local branch is named master instead of main. This is a common issue because older versions of Git default to master while GitHub uses main.
20. The Command to Rename Your Local Branch
To address this problem, you need to rename you branch from master to main. In your Git CMD, run:
bash
git branch -m master main
If you want to confirm your current branch name run:
bash
git branch
Note, you would have need to create a repository with the correct name at Step 16 for this to work.
21. After You Create the Repository
Once you've created the empty repository on GitHub, your existing git remote add command is already correct. You can simply run the push command again:
bash
git push -u origin main
If you get E:\Stuff\Unreal\DemoProject>git push -u origin main remote: Permission to yourgitaccount/DemoProject.git denied to impulseresponseenterprisesltd. fatal: unable to access 'https://github.com/yourgitaccount/DemoProject.git/': The requested URL returned error: 403
It means you are logged into GitHub as the wrong account. Git is trying to push to yourgitaccount/DemoProject but your stored credentials belong to another account, which doesn't have permission to access that repository.
22. The Fix: Switch GitHub Accounts
You need to clear the cached credentials and log in as yourgitaccount.
Open Windows Credential Manager:
Press Windows Key + R, type control, and press Enter
Click on "User Accounts" → "Credential Manager"
Or search "Credential Manager" in the Start Menu
Select "Windows Credentials"
Find GitHub credentials:
Look for entries like git:https://github.com or https://github.com
Click the dropdown arrow next to it
Click "Remove" or "Delete"
Try pushing again:
bash
git push -u origin main
This time, a browser window will open asking you to log in. Sign in as yourgitaccount (not the other account).
23. Check if the Push Completed
Look at your Git CMD window. The git push -u origin main command should have continued running. You should see output like:
text
Enumerating objects: 150, done.
Counting objects: 100% (150/150), done.
Delta compression using up to 8 threads.
Compressing objects: 100% (120/120), done.
Writing objects: 100% (150/150), 12.34 MiB | 2.34 MiB/s, done.
Total 150 (delta 30), reused 0 (delta 0), pack-reused 0
To https://github.com/yourgitaccount/DemoProject.git
* [new branch] main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.
24. Verify the Push on GitHub
Go to https://github.com/yourgitaccount/DemoProject
Refresh the page
You should see all your Unreal Engine project files:
DemoProject.uproject
Content/ folder
Source/ folder
Config/ folder
.gitattributes (LFS config)
.gitignore