Introduction to Git –- Fall 2024
Learn More →
Learn More →
Learn More →
Learn More →
For this course we recommend using ThinLinc, but if you have your own installation of another SSH client that you prefer, you are welcome to use that. We will be using the command line only.
ThinLinc can also be used from a browser: https://rackham-gui.uppmax.uu.se
If you prefer a different SSH client (terminal, etc.), you connect with ssh -Y <user>@rackham.uppmax.uu.se
NOTE If you are not connecting from within the domain of a Swedish university, 2FA may be needed.
Git is already installed on Rackham, but you need to set your name and email globals unless you have already done this at some earlier time.
$ git config --global user.name "Your Name"
$ git config --global user.email "name@example.com"
You may also want to set your editor. We recommend nano, but other options are vim and emacs (or notepad on Windows).
$ git config --global core.editor nano
Create an example folder and cd into that, then create a file test.txt:
$ mkdir <mydir>
$ cd <mydir>
$ touch test.txt
Now initialize a repository and add the new file:
$ git init
$ git add test.txt
Now commit the change. The editor which you configured earlier should open. Add an example commit message:
$ git commit test.txt
Now let us look at the log:
$ git log
When you do git log
, you should see something like:
commit ff8b6f699d98c72d5cffc64d65a1c618b976b45a (HEAD -> master)
Author: Birgitte Brydsö <bbrydsoe@cs.umu.se>
Date: Thu Sep 17 13:53:59 2020 +0200
Test of git
but with name, email and commit message different.
If that is the case, your Git should be configured correctly.
For the individual hands-on part of the course, we have created some course materials which you will download from either the course website, the course GitHub, or the "important information" page.
course-intro-git
wget https://github.com/hpc2n/course-intro-git/archive/refs/heads/main.zip
)unzip main.zip
.course-intro-git-main
.