HUGE ISSUE - Switching Git branches corrupting assets! Have to reimport all to fix!

Since updating to Unity 2019.3 switching branches in Git corrupts assets. This corruption seems to be in Unity’s library/caches since the corruptions don’t show in git and reimporting all resolves the issue but it takes ~30 mins for our project.

Is anyone else experiencing this issue?

We have a team of people experiencing this issue. It seems as though closing Unity before switching branches reduces the likeliness of it happening.

What do I mean by corrupts? Various scripts and prefabs which changed in the branches I’m switching between will need to be reimported but knowing which ones isn’t always possible. Sometimes components lose references which we won’t discover until we play that part of the game. These lost references don’t show up in Git as changes so they can’t simply be reverted, this is also something of a relief because we can’t commit the corruptions. These corruptions could however unknowingly end up in a production build :hushed:

Reimporting frequently feels like…

4 Likes

I guess no one else is experiencing this issue :frowning:

Are you versioning the library folder?

@bobisgod234 Thanks for trying to help, but we’re definitely not version controlling the library folder.

It’s not just you. We have exactly the same issue. Note that you don’t always have to reimport everything. Sometimes it helps to reimport just the affected asset.

1 Like

@meta-ben_1 Sorry to hear you’re having trouble :frowning:

Are you also using Asset Pipeline v2?

Our problem is if something has corrupted and we don’t immediately notice. What if we do build and release it with that corrupt asset. We do testing but sometimes bugs survive.

We’ve updated to Unity 2019.4.6f1 and are still experiencing the same issue.

We’ve updated to Unity 2019.4.8f1 and are still experiencing the same issue :frowning:

Yeah, same here. That and we get random changes in (untouched) prefabs where data just moved to different locations in the file. Really annoying

1 Like

We’ve updated to Unity 2019.4.14f1 and are still experiencing the same issue :rage:

Are you keeping Unity minimized during source control operations?

@Neto_Kokku yes and we’re closing Unity when doing anything other than committing or pulling changes into the current branch.

We have been living with this issue for several months. This bug is making us very hard to work in a medium size team with different branches because we get some prefabs with missing references after switching to a different branch.

1 Like

We’ve updated to Unity 2020.3.10f1 and are still experiencing the same issue :face_with_spiral_eyes:

1 Like

Still happens all the time to me as well. Please Unity, fix this, it makes development a struggle when version control isn’t even viable. Honestly, it’s really embarrassing…

Did any of you report a bug on this? Got the bug number?

We haven’t been able to able to reliably reproduce the issue :frowning:

Btw it’s still happening in Unity 2020.3.13f1 :frowning:

For those who are experiencing this issue, select all the prefabs in your project and re-import them. I’ve been told by my coworkers that it generally resolves the issue when it happens and It’s much quicker than reimporting your whole project.

@Tautvydas-Zilys - Ok so here is an example of the issue.

We have a prefab that is referencing an asset on disk.

On my computer the prefab has the wrong GUID for the asset it is referencing but in the inspector the reference remain intact. There are no changes to assets present in source control.

On another computer, in the inspector, the prefabs reference to the asset doensn’t exist. There are no changes to assets present in source control.

The asset had recently been renamed and changes made to it.

Edit: I took a screenshot. On the left is the prefab, in the center is the editor inspector of the same prefab, on the right is the asset referenced in the _moreProgress field on the prefab. You can see that even though the reference is present in the editor inspector the prefab has the wrong GUID saved for the _moreProgress field.

:eyes:

Do you recall if the rename was done through Unity or via Windows explorer?

Definately via Unity.