---
title: Course plan 2023
tags: Internal
description: Initial plan for the course flow
---
# Course plan
Materials for the instructors (scripts and exercises) can be found from: https://github.com/hpc2n/intro-git
## Lectures and exercises (modules?)
0. Setup ([markdown](https://hackmd.io/TNMfc_0iQVSOJ1lYQdLM2A), [slides](https://hackmd.io/@git-fall-2022/L0-setup#)) *--- Birgitte*
- Everyone:
- Installs Git
- Creates a repository with `git init`
- Sets their name and email with `git config` (local, global, system)
- Creates a file
- Adds the file with `git add`
- Commits the file with `git commit`
- Everyone
- Clones the course materials
- Everyone should now have functioning Git installation
- Do this on kebnekaise only if people do not have a functional git on their own computer
- Setup an account at GitHub
1. Motivation ([markdown](https://hackmd.io/XYcNwuD-QRewYsOs1CYktg), [slides](https://hackmd.io/@hpc2n-git-2020/L1-motivation)) *--- Birgitte*
- In HPC in particular (batch files, certain type of results, etc)
- **Exercises**: None?
2. Basics commands ([markdown](https://hackmd.io/4xUdYYkVRY2O0vAe9xbpbg), [slides](https://hackmd.io/@hpc2n-git-2020/L3-commands)) *--- Pedro*
- Different ways to create and clone a repository
- Adding files
- Whole file, changes to a file, partial
- Working tree, index / staging area
- Staging and un-staging
- Renaming, deleting
- Committing
- .gitignore
- **Exercises**:
- Create a repo, create a file, stage the file, commit (repeat with knowledge)
- Partial staging
- Move files around and commit
- Several hands-ons so that people understand the difference between the working tree, the index / staging area, the commit tree and the stash). People should really get this.
3. Basic concepts ([markdown](https://hackmd.io/DmwNjd9fS4ypfOOcUBDtlA), [slides](https://hackmd.io/@hpc2n-git-2020/L2-concepts)) *--- Birgitte*
- Blobs
- Content-based addressing
- Files
- Trees
- Directory tree
- Working tree
- Commit tree
- Commits
- Author, committer, …
- References (Refs)
- Simple, symbolic
- Tags?
- **Exercises**: None?
4. Commits ([markdown](https://hackmd.io/bNrMqoLrSry7F-dpIlA1MA), [slides](https://hackmd.io/@hpc2n-git-2020/L4-commits)) *--- Diana*
- History / log
- Tags
- HEAD
- Navigation (~, ^, .., etc)
- Diffs
- Reset
- Discarding commits
- Changing commits
- Amend, revert, …
- Recovering the head
- Stash (with --keep-index as a part of a recommended workflow (p. 55))
- Rebasing? (Might be too advanced topic)
- Bisect
- This could really sell the idea to some!
- **Exercises**:
- Modify a repository in two different ways, create two commits, ... Should use git stash --keep-index.
5. Branches ([markdown](https://hackmd.io/fktNFaQ9TNyfkHfszOtXDw), [slides](https://hackmd.io/@hpc2n-git-2020/L5-branches)) *--- Diana*
- Why use branches?
- Basics concepts
- Creation, deletion
- Switching (uncommitted changes etc)
- Visualization
- Uncommitted changes…
- Stashing, discarding
- Conflicts
- Rebasing
- Merging strategies
- Cherry picking
- **Exercises**:
- internal-examples/discard-local-changes
- Requirements: **git pull**, git diff HEAD origin/master, git stash *, git reset --hard HEAD~, git checkout -- file.txt
- Idea: Repeated exercise first with a local branch and then with a remote branch? One as an example, one as an exercise?
6. Working with remotes ([markdown](https://hackmd.io/JhLe07eDQOuaefe6covauQ), [slides](https://hackmd.io/@hpc2n-git-2020/rynM7VWQD#/)) *--- Pedro*
- Basics concepts
- Pull, push, fetch
- Tracking
- Several remotes?
- Using GitHub
- ssh keys
- Good “manners”
- When to use revert, rebasing, etc
- **Exercises**:
- internal-examples/merge-rebase
- Requirements: git status, git diff, git add, git commit, git push, git pull, git log, git reset --hard HEAD~, pull --rebase
- Rebasing small commits into larger ones and pushing them to remote(
7. Teamwork ([markdown](https://hackmd.io/Pm8Lm6dXTgeZex9cKpgvBg), [slides](https://hackmd.io/@hpc2n-git-2020/L7-teamwork#/)) *--- All*
- Work in small teams?
## Advanced topics
- Tags / Releases
- GitLab, GitHub
## These should go somewhere:
- Other stuff
- Git on Windows. git-scm.com etc.
- GitLab, Github, Bitbucket webpages. How to use them. Keys and key security issues.
- Graphical interfaces to Git, tools for Git (Git kraken, ...)
## Preliminary schedule
(Should be broken into four half-days for 2021)
| Time | Description |
|------|-----------------------------------------|
|09:00 | **0. Introduction and setup**
|09:30 | **1. Why use version management?**
|09:55 | Break (5 min)
|10:00 | **2. Basic concepts**
|10:55 | Break (5 min)
|11:00 | **3. Basic commands**
|12:00 | Lunch break (60 min)
|13:00 | **4. Traversing the commit tree**
|13:55 | Break (5 min)
|14:00 | **5. Branches, merges and conflicts**
|15:00 | Coffee break (30 min)
|15:30 | **6. Working with remotes**
|16:25 | Break (5 min)
|16:30 | **7. Teamwork**
|17:30 | End of the course