Git

From Biowikifarm Metawiki
Revision as of 00:25, 20 September 2012 by Gregor Hagedorn (Talk | contribs) (intermediate saving)

Jump to: navigation, search

Installed through (git-doc not really necessary):

* using http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt
* http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server
sudo apt-get install git-core gitweb
cd /var/lib; sudo mkdir git; # NOT /var/cache/git/ as in some instructions!
cd /var/lib/git/; sudo mkdir biowikifarm.git; cd biowikifarm.git; sudo git init; sudo echo "biowikifarm git repository" > .git/description
sudo git config --global user.name "DEBIANUSERNAME"; sudo git config --global user.email "THENAME@gmail.com"; 
git config -l ## only to verify, output should be correct name and email
echo "First test content" > test.txt; sudo git add .; sudo git commit -a
# change owner so www-data can access:
cd /var/lib/git; chown -R www-data.www-data .
cd /var/www/; sudo mkdir git # linking repos into this
cd /var/www/git; sudo ln -s /var/lib/git/biowikifarm.git biowikifarm
# copy gitweb.cgi, logo and css files into /var/www/git:
sudo cp /usr/share/gitweb/* /var/www/git; sudo cp /usr/lib/cgi-bin/gitweb.cgi /var/www/git
# change /etc/gitweb.conf:
sudo nano /etc/gitweb.conf
# to edit: add /git/ in front of gitweb.css etc.

Note: git has not access control, i.e. anyone can clone and commit to a repo. Gitosis is no longer recommended, but apt-get gitolite might be working well.

Note: as of Jan 2012, nginx is not up to serving git directly, the nginx web-dav implementation being incomplete (http://nilvec.com/nginx-and-git-via-http/). We therefore proxy the git directory to apache and setup git for apache. Note that the config is set to share the same apache passwd file between svn and git!

nano /etc/apache2/conf.d/gitweb
a2enmod dav_fs; /etc/init.d/apache2 restart


TO CONTINUE HERE WITH TESTING!


Managing git users: git is like svn and cvs in many respects. However, every git project actually contains its own repository, and git permits users to synchronize their repositories typically with others that start as a clone of it, or one it is cloned from. Generally collaboration takes place by synchronizing to a git repository containing one of the clones designated as a master. This could take place on a single machine via the file system, but the most convenient way is to set up, or use an existing, git hub. Popular public hubs are github which permits only public git repositories, and bitbucket, which provides for public and limited private hubs. Whether we deploy a hub for biowikifarm will need some discussion about a number of things, e.g. what is the nature of the resources we mean to collaborate on, will those collaborations typically take place on the collaborator's own machines and need an easy way to synchronize to a master on a biowiki machine, etc. The latter is the closest analogy to the way svn works, but where git shines is in keeping each users revision tracking in their own local repository (very roughly analogous to an svn checkout), but with complete version tracking of that user's work, later synchronized to another repo, e.g. one on the hub). If all of the projects are meant to be fully publicly readable throughout development, it may make more sense to have masters on github or another public hosting service and have no hub maintenance on biowikifarm. In that scenario, if the resource is meant to be available on the biowikifarm, there would be a biowikifarm git repo on biowikfarm which would be synchronized to the master and if necessary built and deployed on biowikifarm.