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: