Search Unity

Prefab Version Control Bug (Quickfix provided)

Discussion in 'Prefabs' started by alexisrabadan, Jun 25, 2019.

  1. alexisrabadan

    alexisrabadan

    Joined:
    Aug 26, 2014
    Posts:
    82
    Pretty sure that this is a consistent bug. If I have 4 prefabs (RockA, RockB, etc.) and I want to delete RockA then I rename RockD to "RockA". This change works fine on my local project, but these changes don't seem to translate well into version control (git).

    Both scene references and object references (through components) to the new RockA (previously RockD) are lost. The only workaround is to not rename RockD, or rename it to something else, which is a bit annoying if we want to follow naming conventions.
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Do you do the rename from inside Unity or externally? (You should do it from inside Unity.)
    Do you have .meta files set to be visible and remember to commit those as well? The .meta files should be renamed as well (which will happen automatically if you do it from inside Unity) and then that rename must be committed to git as well.
     
  3. alexisrabadan

    alexisrabadan

    Joined:
    Aug 26, 2014
    Posts:
    82
    Yes, renaming is done withing Unity, and .meta files are committed as well.

    The weirdest thing about this is that the change is not fixable using source control. We can delete the file through source control, then discard that change, essentially bringing in a fresh copy of the prefab and it will still have references lost. Deleting the library did not help either.
     
  4. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Ok, sounds odd. To be able to look into it we'll need a bug report with the project prior to the problem and with the steps, inside and outside Unity (e.g. what exactly to do with git as well), to make the issue appear.

    If you haven't upgraded to the latest point release of whatever version you're on, that would be a good thing to start with though.