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:
- Is there a standard way to merge branches in a bare repo?
- Is this not straight-forward because the setup of my repos is poor? (In which case, how would you modify this architecture for best practices?)