<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>So I thought that was that, but then I came across a few problems and found out that I also needed to change the default group of the new developer accounts I created.  This would enable the user to maintain the correct group ownership when they change the repository (through git pull for example). In our example it will make/update files with the group *work*   

To do this I did:

bc.. newgrp [group_name]

p. To verify the default user group just type in this command whilst logged in as the user.

bc.. id

p. The first *gid* should be set to the new group. Or you could just create a file and have a look at the group ownership.

I also found out that I need to add the following line into my *config* file under my remote git repository

bc.. sharedrepository = 1

p. It all seems to be working correctly. Multiple people can commit to the repository and they can do git pulls on the server maintaining correct group permissions. 

h2. References:

* "How To: UNIX Add A User To A Group":http://www.cyberciti.biz/faq/unix-add-user-to-group/
* "Tech Tip: Manage user groups in Linux":http://articles.techrepublic.com.com/5100-22_11-5349294.html

&lt;small&gt;
Image from : "silversprite":http://www.flickr.com/photos/silversprite/2636812931/
&lt;/small&gt;</body>
  <category-id type="integer">2</category-id>
  <comments-count type="integer">46</comments-count>
  <created-at type="datetime">2009-02-20T00:00:00Z</created-at>
  <id type="integer">32</id>
  <live type="boolean">true</live>
  <slug>git-linux-group-access</slug>
  <summary>!http://hamza.khan-cheema.com/images/no-tresspass.jpg! For a recent project I had to setup a remote Git repository that was going to be used by multiple contributors.  I had a few issues with permissions that I had to work thorough, so I thought I would make a note of them in case anyone else has similar issues. 

I first created a new Linux user for the project  and then created a bare Git repository by following "these instructions":http://paulbarry.com/articles/2008/12/29/quick-and-dirty-git-repository in the new users home directory.  For examples sake lets say that the new git repository is owned by the *work* user with the *work* group.

I then created new user accounts for each of the developers.  This would allow them to have ssh access to the box and commit to the repository.

I then added each new user to the *work* group by using the following command:

bc.. usermod -G [group_name] [user_name]
</summary>
  <title>Git and Linux group access</title>
  <updated-at type="datetime">2009-02-20T07:27:13Z</updated-at>
  <user-id type="integer">1</user-id>
</post>
