Git

Git is served by gitolite and uses gitweb as web interface.

The web interface can be accessed at: http://speedy.ms.northwestern.edu/gitweb

Your individual access to gitolite can be tested by using:

ssh -T git@speedy.ms.northwestern.edu

If it asks for a password, you should contact me (Tom) to setup your private key pair

TCi77:~ tomcool$ ssh -T git@speedy.ms.northwestern.edu
hello tomcool, this is gitolite v2.0.3-43-g7b8866d running on git 1.7.5.4
the gitolite config gives you the following access:
     R   W 	fwd_proj
     R   W 	norio-code
     R   W 	sectioner-server
    @R_ @W_	testing

Note: 

  • R means read access
  • W means write access
  • @R_ means read access but not explicitly defined (for example everybody is allowed)

 

Getting Repository

If you have determined that you have access to a repository, you can clone it (get a local copy) using the following (example for testing repo):

git clone git@speedy.ms.northwestern.edu:testing

This will create a folder called testing on your local computer where the contents will be cloned.

Updating Repository

If changes have been made remotely, you can get the updates by running the following commands:

  • If it’s the first time:
    git pull origin master
  • Otherwise:
    git pull

Editing Files

Changing files

Editing files is done normally but once the files have been edited, you need to add them to specify to git that you want those changes saved.

git add <file>

Note: SVN only requires this to be done once when the files are first created whereas git requires this to be done every time you want changes pushed

Committing the Changes

Once the files have been added you need to commit the files. This can be done using the following command:

git commit -m "a message to describe changes made"

Once this is done, the changes have been updated in the local history

Uploading To Server

The files still have not been updated on the remote computer. To do that, the following command needs to be run:

  • The first time (after every clone):
    git push origin master
  • The following times:
    git push

Submodules

Submodules are an advanced feature of git that allows users to actually clone a repository INSIDE another repository. This is extremely useful for shared code. git will also remember what revision was used so that if a newer version of the shared code exists but is incompatible you can still use the older code.
A very good (simple) tutorial can be found here:

http://chrisjean.com/2009/04/20/git-submodules-adding-using-removing-and-updating/

Web Interface

The web interface is gitweb and it can be accessed here. The anonymous user and password are gitweb/gitweb. This allows you to see the repositories that have been declared as readable by the gitweb. Usually, you as user have more repositories enabled. To be able to view all the repositories that YOU have access to you first need to set a http password.

Setting a HTTP password

Setting up an http password is done in the following fashion:

ssh git@speedy.ms.northwestern.edu htpasswd

and then following the onscreen instructions

Using said password

The website is accessed at the same location (gitweb) but you just input login (displayed when you run ssh -T git@speedy.ms.northwestern.edu) and your newly set password