Introduction to Git --- Fall 2020 # Lecture B: Using Kebnekaise for the Git course <!-- .slide: data-background="#ffffff" --> ![TOC](https://www.hpc2n.umu.se/sites/default/files/umu-logo-left-se.png =250x) ![](https://www.hpc2n.umu.se/sites/default/files/hpc2n-logo-text5.png =250x) ![](https://www.hpc2n.umu.se/sites/default/files/images/SNIC_logo_autocrop.png =250x) <small>Slides: https://hackmd.io/@hpc2n-git-2020/LB-Kebnekaise#/</small> --- ## Connecting to Kebnekaise <!-- .slide: style="font-size: 30px;" --> 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. * Download the client from https://www.cendio.com/thinlinc/download and install it. * Start the client. Enter the name of the server: kebnekaise-tl.hpc2n.umu.se and then enter your own username. * Go to "Options" -> "Security". Check that authentication method is set to password. * Go to "Options" -> "Screen" and uncheck "Full screen mode". * Enter your HPC2N password. Click "Connect". More information here: https://www.hpc2n.umu.se/documentation/guides/thinlinc --- ## Setting up Git <!-- .slide: style="font-size: 32px;" --> Git is already installed on Kebnekaise, but you need to set your name and email globals *unless you have already done this at some earlier time*. * Open a terminal. In ThinLinc: Go to the menu at the top. Click “Applications” → “System Tools” → “MATE Terminal”. * Set your global name: `$ git config --global user.name "Your Name"` * Set your global email: `$ git config --global user.email "yourname@example.com"` You may also want to set your editor. We recommend vim, but other options are nano and emacs. * `$ git config --global core.editor vim` --- ## Testing your configuration <!-- .slide: style="font-size: 32px;" --> Create an example folder and cd into that, then create a file test.txt: ```bash $ mkdir <mydir> $ cd <mydir> $ touch test.txt ``` Now initialize a repository and add the new file: ```bash $ git init $ git add test.txt ``` Now *commit* the change. The editor which you configured earlier should open. Add an example commit message: ```bash $ git commit test.txt ``` --- ## Testing your configuration - continued <!-- .slide: style="font-size: 32px;" --> Now let us look at the log: ```bash $ git log ``` When you do `git log`, you should see something like: ```bash 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. --- ## Download the course materials <!-- .slide: style="font-size: 32px;" --> For the individual hands-on part of the course, we have created some course materials which you will download from the course website or the "important information" page. * Course website: https://www.hpc2n.umu.se/events/courses/git-fall-2020 * Download the material, then please go to the terminal window where you have downloaded and set up Git. * Change the directory to wherever you wish to have the course material. * Copy/transfer the tarball there * Unpack with `tar zxvf <tarball>`
{"metaMigratedAt":"2023-06-15T13:00:26.189Z","metaMigratedFrom":"YAML","title":"Lecture B: Using Kebnekaise for the Git course","breaks":true,"description":"Git installation, use of Kebnekaise, etc","contributors":"[{\"id\":\"70f80b64-a87f-47db-ba95-b3b587a1530d\",\"add\":4516,\"del\":1073},{\"id\":\"bd9c8894-7661-4869-9e25-91a504129025\",\"add\":3,\"del\":6}]"}
    637 views
   owned this note