<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>MemberManual/VersionControl/git</title><revhistory><revision><revnumber>16</revnumber><date>2014-04-30 06:42:47</date><authorinitials>ClintonEbadi</authorinitials></revision><revision><revnumber>15</revnumber><date>2014-04-30 06:42:23</date><authorinitials>ClintonEbadi</authorinitials><revremark>.hcoop-git will exist for almost all members, and the page needs to be rewritten to be slightly clearer</revremark></revision><revision><revnumber>14</revnumber><date>2013-01-14 09:20:36</date><authorinitials>ClintonEbadi</authorinitials><revremark>cat / update</revremark></revision><revision><revnumber>13</revnumber><date>2009-04-03 16:00:31</date><authorinitials>MichaelOlson</authorinitials></revision><revision><revnumber>12</revnumber><date>2008-07-07 04:28:04</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>11</revnumber><date>2008-06-22 17:10:23</date><authorinitials>MichaelOlson</authorinitials></revision><revision><revnumber>10</revnumber><date>2008-06-22 05:12:04</date><authorinitials>MichaelOlson</authorinitials><revremark>Now refresh projects and cached front page every 15 minutes</revremark></revision><revision><revnumber>9</revnumber><date>2008-03-31 01:35:46</date><authorinitials>MichaelOlson</authorinitials><revremark>Clarify that workdir was preexisting in this case</revremark></revision><revision><revnumber>8</revnumber><date>2008-03-31 01:32:37</date><authorinitials>MichaelOlson</authorinitials><revremark>Revert to revision 6.</revremark></revision><revision><revnumber>7</revnumber><date>2008-03-29 14:50:58</date><authorinitials>JustinLeitgeb</authorinitials><revremark>order of parameters to symlink command was reversed: fixed</revremark></revision><revision><revnumber>6</revnumber><date>2008-03-26 06:12:58</date><authorinitials>MichaelOlson</authorinitials><revremark>Mention dela</revremark></revision><revision><revnumber>5</revnumber><date>2008-01-22 02:13:15</date><authorinitials>MichaelOlson</authorinitials></revision><revision><revnumber>4</revnumber><date>2008-01-22 02:12:13</date><authorinitials>MichaelOlson</authorinitials><revremark>Explain how to change description</revremark></revision><revision><revnumber>3</revnumber><date>2008-01-22 02:00:08</date><authorinitials>MichaelOlson</authorinitials><revremark>Make sure that directories are world-readable.</revremark></revision><revision><revnumber>2</revnumber><date>2007-11-14 05:16:32</date><authorinitials>MichaelOlson</authorinitials><revremark>Typo</revremark></revision><revision><revnumber>1</revnumber><date>2007-11-12 06:18:11</date><authorinitials>MichaelOlson</authorinitials><revremark>Initial contents</revremark></revision></revhistory></articleinfo><para>This page describes the ways in which we use git at HCoop. </para><section><title>System-wide git</title><para>We have set up a gitweb repository viewer at <ulink url="http://git.hcoop.net/"/>.  We also have a git daemon, which can be used to quickly retrieve a project.  People can host projects there simply by adding bare git repositories under their <code>~/.hcoop-git/</code> directory.  This directory can be a hierarchy if you want to categorize your projects. </para><section><title>Getting started</title><para>You should have a directory named <code>~/.hcoop-git</code>, but if your account is old enough you may have to create it manually: </para><screen><![CDATA[mkdir ~/.hcoop-git
fsr setacl ~/.hcoop-git system:anyuser read]]></screen><para>The gitweb interface and the git daemon will pick it up any repositories stored in the directory automatically. </para></section><section><title>Making projects available</title><para>It is recommended that you put bare git repositories under <code>~/.hcoop-git</code>.  Bare git repositories are the <code>.git</code> directories within a git project.  If you want to keep a (pre-existing) copy of the working directory elsewhere, then do the following.  <emphasis role="strong">PROJECT</emphasis> is the name of your project.  <emphasis role="strong">WORKDIR</emphasis> is the location of your working directory. </para><screen><![CDATA[ln -s WORKDIR/.git ~/.hcoop-git/PROJECT.git
fsr setacl ~/.hcoop-git/PROJECT.git/. system:anyuser read]]></screen><para><emphasis role="strong">Note that the above command is &quot;fsr&quot;, not &quot;fs&quot;!</emphasis> </para><para><emphasis role="strong">If you forget to run this command on any subdirectories in ~/.hcoop-git, none of your projects will show up in the gitweb interface!</emphasis> </para><para>A better method is to mirror the repository into <code>~/.hcoop-git</code>. This should Just Work and pick up the correct permissions from the <code>~/.hcoop-git</code> ACL. You can also use this method to mirror repositories hosted elsewhere (but you'll need to manually pull, or write a cron job to do so): </para><screen><![CDATA[git clone --mirror $PATH-TO-YOUR-PROJECT $PROJECT-NAME.git]]></screen><para>Alternatively, you can copy the <code>.git</code> directory from elsewhere and then run the <code>fsr setacl</code> command mentioned above. </para><para>When you have directories of bare git projects being served by gitweb, it is the convention to name them in this fashion: that is, the name of the project, followed by &quot;.git&quot;. </para><para>It will take up to 15 minutes for any new projects to show up on the web interface, because we cache the front page. </para><para>To change the description displayed on the web interface for the project, edit the file <code>~/.hcoop-git/PROJECT.git/description</code>. </para><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/MemberManual/VersionControl/git/CategoryMemberManual#">CategoryMemberManual</ulink> <ulink url="https://wiki.hcoop.net/MemberManual/VersionControl/git/CategoryNeedsWork#">CategoryNeedsWork</ulink> </para></section></section></article>