Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I do "git pull" automatically when my server startup

I am using ec2 instance @ ubuntu . I am trying to automatically do "git pull" after i launched a new instance from my AMI. The repo dir is already in my AMI, all i need is update the repo.

what i am doing now is I put "git pull origin master" in rc.local.... but it doesn't work....

like image 841
Wen Avatar asked Apr 10 '13 20:04

Wen


2 Answers

I got it to work..

sudo -u ubuntu -i git --git-dir=/home/ubuntu/blastoff/.git --work-tree=/home/ubuntu/blastoff/ fetch origin sudo -u ubuntu -i git --git-dir=/home/ubuntu/blastoff/.git --work-tree=/home/ubuntu/blastoff/ merge origin/master

like image 120
Wen Avatar answered Sep 25 '22 08:09

Wen


git --git-dir=some/dir/.git pull origin master should work

like image 42
AJ. Avatar answered Sep 21 '22 08:09

AJ.