Skip to content

Instantly share code, notes, and snippets.

@z3nth10n
Last active September 13, 2019 02:09
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 z3nth10n/63421be63b172e657380a4f55f90449f to your computer and use it in GitHub Desktop.
Save z3nth10n/63421be63b172e657380a4f55f90449f to your computer and use it in GitHub Desktop.
How to create packages for Unity3D with Github

In this tutorial I will show how to create packages for Unity using orphan branches in Github.

The idea is simple, just clone your project (you will need to work with a copy in case you don't want to checkout (switch) branches too many times):

$ git clone <url>

Then create a new orphan branch:

$ git checkout --orphan unity-<ver>

Where <ver> represents the version of the package.

Then remove all the contents from the orphan branch:

$ rm -rf *

Then just copy the contents from the original folder, and commit/push it:

$ git add .

$ git commit -m "Create release"

$ git push origin unity-<ver>

In case you need to add this package as a submodule just add it as shown here:

$ git submodule add -b unity-<ver> <url>

In case you need to update it, just use:

$ git submodule update --remote --merge

Some examples can be see here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment