Search Unity

[git] is it save to go to an older commit?

Discussion in 'Formats & External Tools' started by MrMatthias, Apr 16, 2019.

  1. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    Is it save to go to an older commit or might it mess with the library? Should the project be closed? What's the best practice?
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    I find that in general, it's fine to switch branches/commits as long as Unity doesn't have focus. Make sure that git's done changing files before you switch back to Unity, so you don't get issues where both programs are messing with the same files at the same time.

    Occasionally, I get Unity into a strange state after a merge or branch change where the scene view and the hierarchy seem to be disconnected. In that case, restarting Unity fixes all of those issues, so you should be fine either way.

    If you want to be super-safe, you can turn off Unity, but I don't generally bother doing that.
     
    MrMatthias likes this.
  3. andrewhoke

    andrewhoke

    Joined:
    Aug 29, 2018
    Posts:
    22
    The library will rebuild/re-import any assets that need to be re-imported. It should never really be a concern as Unity does a good job of managing it itself. As long as you keep in mind what Baste said, you will be fine.