User Tools

Site Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
github_best_practices [2019/03/26 15:53] – Add [File Permissions]. Traumfluggithub_best_practices [2019/10/05 14:00] (current) – [File Permissions] Clarify link. Traumflug
Line 188: Line 188:
 A typical problem of developer installations is trouble with file permissions. While the Git repository is owned by the developer, the web server runs as another user. Result: developer can't edit files created by the web server and vice versa. A typical problem of developer installations is trouble with file permissions. While the Git repository is owned by the developer, the web server runs as another user. Result: developer can't edit files created by the web server and vice versa.
  
-Solution is to use extended file permissions: +Solution is to use extended file permissions. First, move //.git// aside
-<code none> + 
-cd <git repository> +  $ mv <git repository>/.git /tmp 
-REPOSITORY=$(basename "${PWD}"+ 
-# Move .git aside: +Then follow instructions at [[Developer Installation#The User Privileges Issue|Developer Installation]]. 
-mv .git /tmp + 
-cd .. +That done, move //.git// back
-Set existing files: + 
-setfacl -Rm u:mah:rwx "${REPOSITORY}" +  $ mv /tmp/.git <git repository>
-setfacl -Rm u:www-data:rwx "${REPOSITORY}" +
-# Set the same as default for file created in the future: +
-setfacl -Rm d:u:mah:rwx "${REPOSITORY}" +
-setfacl -Rm d:u:www-data:rwx "${REPOSITORY}" +
-# Restore Git: +
-cd "${REPOSITORY}" +
-mv /tmp/.git +
-</code> +
-In the above, //mah// is the developer user, //www-data// is the web server user. Change these to your local situation.+
 ===== References ===== ===== References =====
  
   * [[https://blog.mozilla.org/webdev/2011/11/21/git-using-topic-branches-and-interactive-rebasing-effectively/|Mozilla on topic branches]]   * [[https://blog.mozilla.org/webdev/2011/11/21/git-using-topic-branches-and-interactive-rebasing-effectively/|Mozilla on topic branches]]
  
github_best_practices.txt · Last modified: 2019/10/05 14:00 by Traumflug