Search Unity

Version Control and Asset Packages

Discussion in 'External Tools' started by CodeMonke234, May 22, 2015.

  1. CodeMonke234

    CodeMonke234

    Joined:
    Oct 13, 2010
    Posts:
    181
    One of the problems using Version Control with Unity is the size of the Repo.
    But ironically, a lot of the data in the repo is not project specific - all of the AssetPackages are already stored separately on the Asset Store.

    It would be great if the git repo did not have to store anything that was already available in the asset store. Instead, when you deployed to a new machine, you could click a button and have it download all the Asset Package versions required for the project. Only include project specific data in your repo. This would reduce the size of the repo substantially.

    Ideally, all AssetPackages could be stored in a subdirectory off Assets called Packages that is excluded from Version Control. A list or manifest of all packages in the project could then be created and used to download to new machines. This list (like a Rails Gem file) can be used to pull the correct versions of the AssetPackages for the project from the store.


    In the meantime - I was wondering - Is it possible to do this manually? - Given a standard Unity gitgnore, if you simply exclude the Assets directory in .gitignore, but manually include your directories and all of the .meta files e.g. in .gitignore:
    /Assets/**/**
    !/Assets/**/
    !/Assets/**/*.meta

    Also be sure to include any of your own subirectories. e.g.
    !/Assets/_MyScenes/*

    Then, when pulling the repo on a new machine, you just have to remember to download any new AssetPackages.

    Preliminary tests seem to work as long as you remember to import the AssetPackages.(Still testing this approach, use at your own risk)

    1) Edit your .gitignore as above.
    2) Commit any changes as normal.
    3) When pulling those changes on different machine, remember to import any added packages from AssetStore

    Can anyone verify this approach? Would be great and save a ton of repo space and time.

    Even if this works you would still have to keep up-to-date with the most current version of all packages.

    Anyone have thoughts/feedback?
    Is the size of the repo causing issues for other developers too?

    I literally have projects that are 5-10GB or more and almost 90% AssetPackages.
    This can save quite a bit of repo space, and make commits faster - especially when adding big packages.

    :)
     
    Last edited: May 28, 2015
unityunity