Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity and GitHub issues with changes to Metadata

Discussion in 'Formats & External Tools' started by Tawnwen, Mar 11, 2020.

  1. Tawnwen

    Tawnwen

    Joined:
    Oct 30, 2019
    Posts:
    15
    So I've been using Unity for a group school project for a couple of months now. As this is a team project, me and at least one other developer have been using GitHub to keep track of our work and share updates between our computers.

    Main problem (headache, rather) is whenever I do anything, inevitably git bash tells me that Unity has changed several dozen files of metadata and other small changes in the Library folder. I'm assuming this is related to the current running of Unity, saving logs, etc.

    unitywhy.PNG
    whyunity2.PNG

    This happens with pretty much every git status/push/pull/update related command I do, when I try to switch branches, merge branches, etc. etc. It will tell me that I have untracked changes, or that I can't merge because there are merge conflicts with these changes, etc. These changes (which I'd assume were temporary) don't go away if I quit out of my Unity editor entirely and then attempt to add/commit/push, which is what I've tried to standardize to get rid of this problem.

    So far, nothing detrimental has occurred. However, I've been set back an hour or so trying to figure out which combination of commands will allow me to update my local repository to what my teammate has pushed, and continue my work.

    So my question is, is there a standard way to deal with this issue in Unity? Is there a way to "ignore" these small changes that unity makes while I'm working? Or am I doing something wrong entirely?

    This is a pretty open-ended question and is more asking what the best workflow is between github and Unity, and if this is a standard problem. I can provide more details if needed.
     
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    This is standard behavior. Unity creates meta-information in the Library folder of assets converted to Unity objects. One thing to be aware of is that you can delete the Library folder without adversely affecting your project BUT this will result in a reimport (which can take a long time in bigger projects). Usually developers in your situation set up a gitignore file to handle this,

    This StackOverflow item might be helpful:
    https://stackoverflow.com/questions...-for-unity3d-source-control/18225479#18225479

    Note that gitignoring the Library means that you aren't pushing your library files to git, and therefore the other members of your team will have to generate of those files locally.
     
    Tawnwen likes this.
  3. Tawnwen

    Tawnwen

    Joined:
    Oct 30, 2019
    Posts:
    15
    @marc_tanenbaum Thanks! Maybe if I'd thought a bit harder I would've figured I could gitignore the lib folder, as I know it will reimport itself. I think I'll go with that, as our project isn't very large.