Search Unity

Having issues with source control (using git on bitbucket/sourcetree)

Discussion in 'Formats & External Tools' started by ethancodes, Feb 10, 2018.

  1. ethancodes

    ethancodes

    Joined:
    Mar 9, 2015
    Posts:
    30
    I'm hoping someone can help me and my friend out. We are using Unity to create a 2D mobile game. The problem we're running into is that my friend will create the project, put it in a repo, I clone it, and then open it with all kinds of errors and stuff missing. I've put an image with the errors, but from what I read the main issue seems to be the part that says "Rebuilding Library because the asset database could not be found!". I'm not sure why I'm getting these issues. He has two computers and cloned the project to his other computer with no problem. We are both using Unity 5.6.4f1. We've been struggling with this for a few months now and can't seem to figure out what the problem is. I don't think we should need to use LFS for such a small project. And I think we have our gitignore all set up the way it should be, but maybe theres something we missed. Hopefully someone will have an answer for us! Thanks!
     

    Attached Files:

  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    This tutorial is helpful, although it assumes you'll use SourceTree and BitBucket.

    Some tips:
    • Ignore the Library folder. (Use this gitignore) You really only need to sync Assets, ProjectSettings, and UnityPackageManager.
    • Set Serialization to Force Text, Visible Meta Files.
    You might also be interested in using Unity Collaborate. It's easier to get things to sync properly, but the free version has limitations on the project size and number of users.
     
    ethancodes likes this.
  3. wcarbajal84

    wcarbajal84

    Joined:
    Aug 22, 2018
    Posts:
    4
    I've used the same gitignore you posted @TonyLy to create the repo and when I cloned my repo, scene is gone gameobjects gone, everything is gone all my work has disappeared. I get "Rebuilding Library because the asset database could not be found!". I initially set mode to visible meta files. What gives?
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Browse your repo. Maybe you didn't commit your changes, or maybe your gitignore is ignoring too much. Make sure it picks up the entire Assets folder, including meta files.

    As long as everything in Assets and ProjectSettings is in the repo, that's normal. Since the Library folder is ignored, it's not in the repo. When you clone the repo and open it in Unity, Unity will rebuild the Library folder.