Skip to content

Instantly share code, notes, and snippets.

@kghose
Last active December 17, 2015 02:38
Show Gist options
  • Save kghose/5536737 to your computer and use it in GitHub Desktop.
Save kghose/5536737 to your computer and use it in GitHub Desktop.
Setting up to push code from a developer machine to a production machine and have it automatically checkout the latest push.
On production machine
---------------------
mkdir wm.git
mkdir wm
cd wm.git
git init --bare
create a file: hooks/post-recieve
---------------------------------
#!/bin/sh
GIT_WORK_TREE=/home/kghose/Research/wm git checkout -f
chmod +x hooks/post-receive
On devel machine under the repository
-------------------------------------
git remote add production ssh://kghose@172.17.146.192/home/kghose/Research/wm.git
git push production master:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment