Skip to content

Instantly share code, notes, and snippets.

@andybak
Last active June 9, 2018 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andybak/e10ea47d253391de8eceb3393d2eb142 to your computer and use it in GitHub Desktop.
Save andybak/e10ea47d253391de8eceb3393d2eb142 to your computer and use it in GitHub Desktop.
Neater Unity 2018 projects with git submodules and sparse checkout
# Usage
# addpackage [repo url] [package directory name] [Assets dirs to include]
# Example: ./addpackage.sh https://github.com/georgejecook/UnityTimelineEvents.git UnityTimelineEvents "TimelineEvents/*"
git clone --depth=1 --no-checkout $1 Packages/$2/repo
git submodule add $1 Packages/$2/repo
git -C Packages/$2/repo/ config core.sparseCheckout true
git submodule absorbgitdirs
echo Assets/$3 >> .git/modules/Packages/$2/repo/info/sparse-checkout
git submodule update --init --force --checkout Packages/$2/repo
{
"name": "com.ixxy.unitytimelineevents",
"displayName": "Unity Timeline Events",
"version": "0.0.1",
"unity": "2018.1",
"description": "test",
"dependencies": { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment