Skip to content

Instantly share code, notes, and snippets.

@54keesh
Created July 21, 2024 19:58
Show Gist options
  • Save 54keesh/ef42c4c5b45ee3cedfbb2425dc7b93d8 to your computer and use it in GitHub Desktop.
Save 54keesh/ef42c4c5b45ee3cedfbb2425dc7b93d8 to your computer and use it in GitHub Desktop.
git pull via other user in apache/nginx based deployments
OPTIONAL
ensure pulling is possible via www-data user
-> sudo -u www-data git pull
if not add it in visudo
-> git ALL = (www-data) /usr/bin/git pull
add ubuntu to www-data group
-> sudo usermod -aG www-data ubuntu
ensure ubuntu has write permission to that otherwise
-> sudo chmod 755 path/to/directory
You are done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment