I would like to create the following setup for my git repos:
I currently have a local git repo with all my working files. I would like to be able to setup a central bare repository, and two other non-bare repositories -- one for a live application and one for a testing version.
I would like to be able to push changes from local to the central bare repo on a testing branch. Then, on my testing repo, always pull from the testing branch of the bare repository.
When ready to go live with the changes, I would like to be able to merge my testing branch and my master branch in the central bare repository. Then the live repo could pull from the master branch.
So in this scheme, testing repo will always pull from testing branch, and live repo will always pull from the master branch.
I can't figure out how to merge branches in a bare repository though. git-merge and git-checkout don't seem to work without the working tree.
So, my question is two-fold:
Note, this can actually be done on a bare repo, but you have to work around the normal interface.
$ git read-tree -i -m branch1 branch2
$ COMMIT=$(git commit-tree $(git write-tree) -p branch1 -p branch2 < commit message)
$ git update-ref mergedbranch $COMMIT