Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I want to give a detailed answer to this question because I just had to use a gitosis-admin local clone to get somebody else's installation working properly. I think other users might come here looking for help figuring out <strong>what to do if you need to edit gitosis-admin but ONLY have local root access to the filesystem on which the repos live.</strong> If that's how you got here, your intuition is good in that you <em>can</em> clone and edit the gitosis-admin repository locally. To make everything work, though, you have to be careful about how you do it. Here are the steps:</p> <p>Preconditions:</p> <ul> <li>You are root.</li> <li>You want to give <code>$USER</code> gitosis-admin access; <code>$USER</code> is a valid user.</li> <li>The gitosis-admin repository lives at <code>$PATH</code>. (On Ubuntu this is typically <code>/srv/gitosis/repositories/gitosis-admin.git</code>)</li> <li><code>$PATH</code> is owned by user "gitosis".</li> </ul> <p>Steps:</p> <ol> <li>If they don't already have one, generate a key pair for the user you want to give gitosis-admin access to. <br> <code>sudo -H -u $USER ssh-keygen</code></li> <li>Make a local clone of the gitosis-admin repo as the gitosis user. <br> <code>sudo -H -u gitosis git clone $PATH</code></li> <li>Add the new public key. <br> <code>sudo -H -u gitosis cp ~$USER/.ssh/id_rsa.pub ./gitosis-admin/keydir/$USER.pub</code></li> <li>Edit the gitosis-admin conf as necessary. <br> <code>sudo -H -u gitosis nano ./gitosis-admin/gitosis.conf</code></li> <li>Commit as the gitosis user. <br> <code>sudo -H -u gitosis git commit -am "Adding $USER" ./gitosis-admin</code></li> <li>Push as the gitosis user. <br> <code>sudo -H -u gitosis git push ./gitosis-admin</code></li> <li>Run the post-update hooks as the gitosis user. <br> <code>sudo -H -u gitosis GIT_DIR=$PATH $PATH/hooks/post-update</code></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload