OMG Did I corrupt my project?

Godot Version

4.4 Stable

Question

OMG. I pushed a bunch of changes to GIT, then Godot said project on disk was newer. I OK’d it, then all hell broke loose. Now the Project Manager doesn’t recognize the project. I tried re-importing it (“Valid project found at path”) but now it’s a Missing Project with a red icon, a warning icon, and “? Missing Date”.

Did I corrupt it? Is this repairable?

have u tried rolling back the changes? you do have version control, no?

from what i can understand, you can try importing the project again via this button:

find the folder that contains the .godot file, and select it again.

3 Likes

Thanks. I think once I’m over my initial panic I’ll pull that last big commit and see if it’s broken, but I have a nagging feeling it is. It was a big one for longwinded reasons, but I’d obviously rather not lose that much work.

I tried re-importing it (“Valid project found at path”) but now it’s a Missing Project with a red icon, a warning icon, and “? Missing Date”. I assume that means the project.godot file is bad (not just a corrupt scene for instance) but I don’t know much about it.

yeah, try rolling back changes.

just to be clear, there is a .godot file in that folder you selected, right? might be a stupid question since the engine seemed to detect it…?

Yeah, there’s a project.godot file. I figure that’s why Project Manager deems the directory valid?

  1. Close your project.
  2. Back up your project by copying the entire project folder somewhere else.
  3. Delete the .godot directory.
  4. Re-open your project.

Everything in that folder should be recreated and hopefully you will be in a better state.

If that fails, you are in luck. Git works on a distributed model. That means that you have a full git repository on your disk. Your last commit before you pushed it is still there. You will have to use the git command line tools. Here’s an article explaining how to do that.

You’re going to need to use git log to identify your commit before you pushed, and then revert back to that. I cannot stress enough that you back up your local code (and therefore git repo) somewhere else before you try any of this. If you mess up with the revert, you’ll want to be able to try again.

Good luck!

3 Likes

Appreciate that, but I can’t open my project because the Project Manager says it’s missing. Reverting makes sense, but I’m going to lose more work than usual with this one, so I was hoping it was easier to un-mangle something more related to the “? Missing Date” message.

You will lose nothing by reverting. You said this happened when you pushed. That means you had already committed everything. It’ll put you back where you were right before initiated the push.

1 Like

So, there’s a twist to this tale. I only suspected things got corrupted before/during the commit I pushed, but I’ve confirmed it. So, I’d actually have to pull an old one.

A few lines were inserted—sometimes more than once—throughout .gd, .tscn, and .godot files (that I’ve found so far) and they break things in various ways depending where they ended up.

The lines are:

<<<<<<< HEAD
=======
>>>>>>> origin/main

I’ve also noticed in some scenes with these insertions, that nearby lines might be duplicated but with two different UIDs specified, so that’s fun. (ext resource type=“Texture2D” uid=“uid://b81wgefvx4k21” <…> type of thing)

I cobbled together a project.godot file after comparing a fresh one to the broken one, and a prior one. It allowed me to open the project, and that’s how I started noticing the corruption. If anyone recognizes those lines, maybe they can help prevent this in the future.

So, I backed up the broken project, and I’ve been attempting to pull those lines out of everything manually to see how unbroken I can make things.

Have you exported any versions? If so this might help GitHub - GDRETools/gdsdecomp: Godot reverse engineering tools
(not particularly helpful here but if someone in the future finds this in search results they might thank me, who knows)

Ok, so that’s called a merge conflict, and takes some work, but isn’t the end of the world. It also happened after your commit. You did a push, and that’s when it happened. Here’s an article on resolving merge conflicts. You can also roll back your commit like I said before. The choice is yours.

3 Likes

What kind of conflict would have sprinkled HEADs all over miscellaneous files (esp without my merge permission)? And, if I was pushing when it did, why would all my local files be corrupt? :exploding_head:

What were you using to push? The Godot plugin? GitBash? Linux Command line?

To fix it just delete those lines, do a git add . Commit again and they should be cleared up if they’re all blank.

Using Sourcetree here.

Any chance the Upgrade UID tool did me dirty here? I converted from 4.4 Dev7 and used the tool as part of this commit.

I just finished combing through and removing all the weirdness (it was less of a pain than redoing all the work), crossed all my fingers, and played straight through successfully :champagne:
The default editor themes and syntax coloring was all messed up too. Pink strings. Yuk.

Thanks for the help everyone!

3 Likes