Question

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:-

  1. Do some coding locally and commit to master branch, when I'm ready to release to production I do:-

  2. git checkout production

  3. git merge master

  4. git push origin production

Where origin is a bare repository on the production server, then I have a post-receive hook which does the following:-

  1. git clone /dir/to/bare_repo /dir/to/production

  2. cd /dir/to/production_dir

  3. GIT_DIR=/dir/to/production/.git

  4. git 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

Was it helpful?

Solution

Use git archive and pipe it through your gzip util.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top