Course plan
Materials for the instructors (scripts and exercises) can be found from: https://github.com/hpc2n/intro-git
Lectures and exercises (modules?)
- Setup (markdown, slides) –- 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
- Motivation (markdown, slides) –- Mirko
- In HPC in particular (batch files, certain type of results, etc)
- Exercises: None?
- Basic concepts (markdown, slides) –- Mirko
- Blobs
- Content-based addressing
- Files
- Trees
- Directory tree
- Working tree
- Commit tree
- Commits
- References (Refs)
- Exercises: None?
- Basics commands (markdown, slides) –- 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.
- Commits (markdown, slides) –- Mirko
- 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.
- Branches (markdown, slides) –- Birgitte?
- Why use branches?
- Basics concepts
- Creation, deletion
- Switching (uncommitted changes etc)
- Visualization
- Uncommitted changes…
- 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?
- Working with remotes (markdown, slides) –- Pedro
- Basics concepts
- Pull, push, fetch
- Tracking
- Several remotes?
- Using GitHub
- 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(
- Teamwork (markdown, slides) –- All
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 |