Last active
December 17, 2015 02:38
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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