Copy files from one user to another permissions issue

I have a user ‘git‘ that owns a git repository. I’m trying to setup a post-update hook that copies the files in the repository to /var/www/site/. I’m still getting a hang of users and permissions in linux, what is the best scheme for this situation?

  • check out a git branch programmatically in a script
  • How to undelete a branch on github?
  • Working on git repo without cd into directory
  • git submodule functionality with sibling?
  • Drawbacks of using GIT-SVN over other SVN clients?
  • How can I insert and retrieve a custom field into a .gitconfig file?
  • git merging two branches interchangeably
  • Git-flow reopening a finished feature
  • What's the difference between git add '*.txt' and git add *.txt?
  • Git Branching model
  • Can I specify Git URLs as dependencies in Buck?
  • Clone of Git repository excluding subdirectory
  • One Solution collect form web for “Copy files from one user to another permissions issue”

    You could either have git own /var/www/site/, and give it 660 permissions on it (read and write, no execute), or make /var/www/site/ world writeable (which is not entirely a good idea, as then any user can copy, edit, etc. files in /var/www/site/). chown could help you change the owner, and chmod can help you change file permissions.

    You can also add git to the group who owns /var/www/site/, and make sure that the group has read/write permissions on /var/www/site/ as well.

    And if you ever need help with chown, chmod, or any other linux command, man can help you out.

    Git Baby is a git and github fan, let's start git clone.