{{WorkInProgressNeedsUpdate}} '''NOTE:''' There is a [http://www.amahi.org/apps/gitweb one-click app] currently in ALPHA being tested.
[http://git-scm.com/ Git] is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do. Coupled with [http://sourceforge.net/apps/trac/sourceforge/wiki/GitWeb%20repository%20browser Gitweb], provides a web interface for browsing your project.
This tutorial will show you how to install, create a repo, and browse that repo on your HDA.
<li>[[Open_Terminal_as_root|Open a terminal as root]] user and do the following:
<li>Look for the ''####-gitweb.conf'' in '''/etc/httpd/conf.d''' (#### is some number, i.e. 1000) file and open it in your favorite editor. Add text after '''ServerAlias''' line
<li>Create '''/etc/init.d/git''' file and add the following
{{Text|Text=<pre>#!/bin/sh
<nowiki>#</nowiki>
<nowiki>#</nowiki> Startup/shutdown script for Git Daemon
esac
exit $RETVAL}}</pre></li>
<li>Set init script to run
{{Code|<pre>chmod 755 /etc/init.d/git;/etc/init.d/git start/sbin/chkconfig git onservice git start}}</pre></li><li>Edit Set User information (change ''/etc/httpd/conf'user.d/gitname''' and '''user.confemail'' and text to the bottom ' accordingly){{Text|Text=<Directory /var/hda/web-apps/gitweb/htmlpre> RewriteEngine On RewriteBase /git/ RewriteRule ^$ gitwebconfig --global user.cgi [L]name "MyHDA" RewriteCond %{REQUEST_FILENAME} !git config -f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (global user.*) gitweb.cgi/$1 [QSA,L]email myhda@localhost</Directorypre>}}</li><li>Create temporary repository{{Code|<pre>cd /var/cache/git/mkdir git init testcd testgit initchown -R git:git ..</test/}}pre></li><li>Add test file and a short description{{Code|cd /var/cache/git/test/echo "test test repo" > description}}</lipre><li>Edit '''config''' and add the following at the bottom{{Text|Text=[gitweb] owner = Your Name}}</li><li>Create local repository and commit{{Code|mkdir ~/testcd ~/test && git initecho 'test' > README
git add README
git commit -a -m "initial README file"}}</pre></li><li>Create SSH rsa public keylocal repository<pre>cd /var/cache/git/{{Code|ssh-keygen -t rsa -C "user@yourispgit clone test test.gitcd test.com"}}gitgit push origin master</pre></li><li>Push to Edit '''/var/cache/git/test/.git/config''' and add the following at the repositorybottom (change '''MyHDA''' as desired){{Code|git remote add origin user@hda.home.com:test<pre>[gitweb]git push origin master}} owner = MyHDA</pre></li>