Teaching basic lab skills
for research computing

Git tutorial links

I promised to post some links related to the Git tutorial I taught on May 24, 2012. Most of my material was based on this excellent online book (free): http://git-scm.com/book/ch1-3.html. Here's another resource with help on specific and common Git commands: http://gitref.org/.

Someone asked the differences between Git and Mercurial, but because I haven't used Mercurial I wasn't able to answer. I found these links that I hope are useful: http://www.wikivs.com/wiki/Git_vs_Mercurial and http://www.rockstarprogrammer.org/post/2008/apr/06/differences-between-mercurial-and-git/. Also, here's a video of Linus Torvalds himself (creator of the Linux kernel and Git) promoting Git (and putting down everything that is not Git):

Finally, someone asked how to set up your own repository on a remote server so you can push and pull from your local computer. This is explained in the Git online book (section 4.2). Briefly, have your project in a directory on the server, then go into that directory and run "git init" (if you haven't already). Go up one directory (your project directory's parent), and run "git clone —bare project project.git" (where "project" is the name of your project directory). This will create a directory called project.git, in which a copy of your repository will be in, minus the "working" files (everything will be hidden, so that running the "ls" command won't show anything). Now from your local computer, you can clone this project by running "git clone user@server.univ.edu:projects/project.git", where "user@server.univ.edu" is your username and server address and "projects/project.git" is the location (relative to your home directory on the server) of your project.

Dialogue & Discussion

You can review our commenting policy here.