git - Amazon Autoscale & Github -


i have installed centos 6.5 / apache , gitbhub on remote server. possible when server starts (or every hour) pull latest commit production branch, force overwriting had locally?

i see use of git push command since auto-scale happen behind firewall, it's useless.

if answered here, sorry.

yes, can add user data instance following command. needs run on directory git repository code is:

git reset --hard head git pull -f origin <your branch> 

or if don't want care directory in:

git --git-dir=<your-git-repo-directory>/.git --work-tree=<your-git-repo-directory> reset --hard head git --git-dir=<your-git-repo-directory>/.git --work-tree=<your-git-repo-directory> pull -f origin <your branch> 

to make run every hour can add cron job creating file under /etc/cron.d/ following content:

0 * * * * <your-user> git --git-dir=<your-git-repo-directory>/.git --work-tree=<your-git-repo-directory> reset --hard head 1 * * * * <your-user> git --git-dir=<your-git-repo-directory>/.git --work-tree=<your-git-repo-directory> pull -f origin <your branch> 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -