Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Squashed Commits Causing Missing Prefab References in Inspector - How to Avoid?

Discussion in 'Editor & General Support' started by doublegumbo, Jul 12, 2019.

  1. doublegumbo

    doublegumbo

    Joined:
    Oct 24, 2013
    Posts:
    53
    Hello,

    I recently tried using Sourcetree's interactive merging / rebase tool to 'squash' some of my more incremental commits.

    Several of my prefabs and scenes had gone through iterative changes during this time, and when I actually squashed the commits, I got several re-importing windows and a query from Unity asking if I wanted to 'Reload' the currently open scenes (which I had just saved prior to committing). Being naively optimistic that this wouldn't do any harm, I pressed 'Reload'. Nothing seemed amiss and most of my cumulative changes were unchanged. But during a play-test the following day, I noticed that several of my scripts were missing references to prefabs that I had worked on during the session which I had squashed my commits.

    - Has anyone experienced this issue when squashing commits? And could this sort of thing have been avoided if I had simply closed Unity before doing the commit squashing?

    - What is the best practice for dealing with squashing commits while using prefabs and Unity in general? I'm willing to drop the technique if it's known to be unreliable with Unity's prefab system.


    I appreciate whatever guidance the community might have on this topic.

    thanks
    -g