Skip to content

Instantly share code, notes, and snippets.

@xtarx
Created August 12, 2015 17:28
Show Gist options
  • Save xtarx/375d20de5994491b2472 to your computer and use it in GitHub Desktop.
Save xtarx/375d20de5994491b2472 to your computer and use it in GitHub Desktop.
make sure to create the SSH using the “apache” user.
# Added this to fix apache git pull
apache ALL = NOPASSWD: /usr/bin/git
sudo su apache
sudo su ec2-user
sudo rm -rf /var/www/html/echogit/
#list file permissions
namei -m
sudo chown -R apache:apache /var/www/.ssh
#add rep to config file in ssh folder
Host echohr
HostName bitbucket.org
IdentityFile /var/www/.ssh/echohr
#creat ssh keys
sudo -Hu apache ssh-keygen -t rsa -f /var/www/.ssh/echohr
sudo cat /var/www/.ssh/echohr.pub
#set permission
sudo chown -R apache:apache /var/www/html/echoHRV1.0
#clone git
sudo -Hu apache git clone git@echohr:ngageu/ecohr.git /var/www/html/echoHRV1.0
#move to upper dir
sudo mv * .[^.]* ..
#get current git version revision
git rev-parse HEAD
sudo -Hu apache git rev-parse HEAD
Refrences
https://github.com/lkwdwrd/git-deploy
https://gist.github.com/oodavid/1809044
permissions and groups gitwriters
http://stackoverflow.com/questions/5144039/shell-exec-and-git-pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment