I'm a total git novice but I've been using Git as a way to easily 'upload' a web application to my production server. This is my workflow:-
Do some coding locally and commit to
masterbranch, when I'm ready to release to production I do:-git checkout productiongit merge mastergit push origin production
Where origin is a bare repository on the production server, then I have a post-receive hook which does the following:-
git clone /dir/to/bare_repo /dir/to/productioncd /dir/to/production_dirGIT_DIR=/dir/to/production/.gitgit checkout -f production
The final checkout command produces the following message:-
Branch production set up to track remote branch production from origin. Switched to a new branch 'production'
Yet the changes I make locally don't appear in /dir/to/production
Any suggestions will be greatly appreciated!
Edit: Just thought I should mention that the changes appear the production branch locally as they should with git merge master when on production. It's the checkout on the remote cloned repository that doesn't seem to work
Use
git archiveand pipe it through your gzip util.