I’ve been trying to get my head around this issue for a while, but can’t figure out a solution for it.
My project is set up using git with LFS configured.
Once I add an Actor to my Map and commit this change to git, I cannot permanently remove it afterwards. In Detail: When I close the editor and open it again later (not immediately after closing, seems this takes a certain amount of time) the deleted Actors reappear.
This is extremely annoying (e.g. in case of re-designing rooms and having nearly invisible - like glass- objects that act blockingly) and caused my quite some headache recently.
I know there’s been some people asking this before (see here and here. And here too), but never with a solution.
Does anyone have an idea how to get rid of this vexing behaviour?
Check LFS config or possibly turn it off. Had some problems too.
Asked my dear AI and came up with this tldr;
best
The issue you're describing, where deleted actors reappear after committing changes to **Git with LFS**, is likely caused by either **Git LFS misconfiguration** or **redirectors/auto-save behaviors** in Unreal Engine. Here's a detailed approach to troubleshoot and resolve this:
---
### **1. Identify the Problem Source**
1. **Actor Persistency Issue**:
- Unreal Engine saves actors in the level `.umap` file. If Git LFS is improperly configured or overwrites files when pulling changes, these deletions may be reverted.
2. **Possible Causes**:
- Unreal Engine auto-saving an older version of the level.
- Redirectors or cached data pointing to outdated versions of the `.umap` file.
- Git LFS not properly tracking the `.umap` file, leading to version mismatches.
---
### **2. Verify Git LFS Configuration**
Ensure `.umap` and other binary files are properly tracked by Git LFS:
1. **Check Git LFS Tracking**:
Run the following command in your project directory:
```bash
git lfs track
Ensure the output includes .umap:
*.umap filter=lfs diff=lfs merge=lfs -text
Manually Track .umap Files:
If .umap files are not tracked, add them to Git LFS:
Going through this step by step, but first have to add a few pieces of information:
Revision Control was (up to now) disabled within Unreal, I’ve been using external tools (commandline and SourceTree)
Push/Pull, collaboration and concurrency is definitely not an issue, since I work alone & locally only (I do sync backups on a daily basis, but don’t push to a remote right now). That also makes it hard to test on a clean clone
A very similar behaviour has occured in the Content Browser, where I moved stuff around and it reappeared the next day, causing ambiguity (same name, different Asset). These were caused by redirectors and could be solved by
forcing an update of those redirectors.
…clicked Save All and the level’s Save button (just to make sure )
git status:
Refresh index: 100% (7107/7107), done.
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: Content/StarterContent/Architecture/Floor_400x400.uasset
deleted: Content/__ExternalActors__/Maps/PyroneumTransporter/7/PZ/LM4A7Y28V7RIBUSX3WOKNZ.uasset
The deleted uasset is listed as change, but the .umap is not. The last changed timestamp on the .umap is from 5 days ago…while I work on this thing every day (What causes changes to the umap?).
This seems to be an issue. Also, the listed modification of the floor asset appears almost every time I commit changes.
Nevertheless, when I open my editor, the camera remains gone. It’ll probably reappear tomorrow. If so, I will get in touch.
What’s noticeable already is the fact that I enabled the UE internal revision control mechanism. It takes longer to start up and performs different operations, i.e. when fixing redirectors (actually performs delete operations on the filesystem when a redirector is no longer needed).
Maybe UE behaved differently when it was set to non-versioned and this caused the issues? This is gonna be interesting to watch!
Other things
Backups are not present in <ProjectFolder>/Saved/Backups
Autosaves contained two earlier versions (both from 2 Months ago), which I deleted. I deactivated the feature for the time being.
So, I will update this thread soon to provide feedback! Thanks, mate!
Use Git with Unreal, as it allows you to track changes in blueprints. There’s an urban myth about issues, but it’s false, and use for submits.
Create a .bat file to handle Push operations.
The real issue lies with SourceTree, which regenerates files deleted/moved in Unreal. Use it only for reverting or advanced actions, but never open SourceTree if you’ve deleted/moved files in Unreal without submitting first.
If you’re working in a team, don’t fix redirectors on your own. Agree on a specific day to do it together, ensuring no one is working at the same time.