From HallCWiki
Jump to: navigation, search

[] Hall C has established a server, hallcgit.jlab.org, to host Hall C software projects being managed with git. The server uses the gitolite package to administer git repositories and access to those repositories.

Viewing git repositories with the web

Repositories that have been marked by their owner as public, can be browsed at https://hallcweb.jlab.org/git/. This site, using the simple Gitweb interface, allows users to browse source code and changes and allows one to download tarballs of projects. It can not be used to anonymously clone a repository. To clone git repositories from hallcgit, one needs to establish access to hallcgit and request read or read/write access to the repositories of interest.

Obtaining access

In order obtain access to hallcgit, you need to give your public ssh key to the hallcgit maintainer, Steve Wood, saw@jlab.org. When sending the key, please also specify which software projects you wish to access.

As users often find themselves working from multiple machines, it is recommended to create a custom ssh key for hallcgit access. To do this, do:

 ssh-keygen -t rsa -f ~/.ssh/id_rsa_hallcgit

Supply the file ~/.ssh/id_rsa_hallcgit.pub to the hallcgit maintainer.

Then edit ~/.ssh/config, adding the following lines

 Host hallcgit
   Hostname hallcgit.jlab.org
   User git
   IdentityFile /home/YOURUSERNAME/.ssh/id_rsa_hallcgit

When constructing URL to use with git, use only "hallcgit", not "hallcgit.jlab.org". (E.g. "git@hallcgit:hcana.git")

To access hallcgit from a different computer, copy id_rsa_hallcgit and id_rsa_hallcgit.pub to the .ssh directory on the new computer and copy the new config lines to the .ssh/config file on that computer.

Creating personal repositories

Normally, a new git repository on hallcgit can only be created by the hallcgit maintainer. However, hallcgit users can request the ability to create "wildcard" repositories. If you wish to create such a repo for a new project, do:

 git clone git@hallcgit:YOURUSERNAME/YOURPROJECTNAME.git

which will create a blank repository on hallcgit and clone it to your machine. (Use hallcgit.jlab.org instead of hallcgit if offsite and not using a custom key as described above.)

If you already have a project under git and wish to push it to hallcgit, then do

 git remote add origin git@hallcgit:YOURUSERNAME/YOURPROJECTNAME.git
 git push origin master

Repositories created this way will initially only be accessible by the creator. To add a user, do either: ( Remember that the YOURPROJECTNAME does NOT include ".git" extension)




depending on if you want to grant read or read/write access. (Use "-" to remove a user). Usernames on hallcgit are usually the same as JLab CUE usernames.

To make your repo show up on https://hallcweb.jlab.org/git/, give the user "daemon" read permission.

  ssh git@hallcgit perms YOURUSERNAME/YOURPROJECTNAME + READERS daemon