These are some examples of previously created materials by mentors that you can use yourself, or for inspiration.
- Git Advanced Slides (slides used to teach previously)
- Git Commands Cheat Sheet (lists lots of git commands used in the session)
- Additional exercises (extra exercises that could be used)
- Resources (additional links and resources for content inspiration and additional learning for trainees)
If you're looking for more inspiration for content to teach, check out the review which covers the session outline in more detail.
-
Why branches?
-
The 3 types of branches:
- the local non-tracking branches
- the local tracking branches
- the remote tracking branches
-
Push/Pull branches to github
-
Create a merge conflict and show how to solve it (use vscode to select which changes to keep).
-
Do an exercise (to basically repeat what was shown before with the slides and all):
- create repo
session_example, both locally and on github - in main, create file
fruits.txt, add the names of 3 fruits, one per line, Commit your changes. - push
mainto github - from
main, create branchfeature/fruits, modify the name of the second fruit and add two new fruits at the end of the file (one per line) - on github, on branch
main, change the name of the second fruit in the filefruits.txt - update your local branch
feature/fruitswith the contents ofmain - push
feature/fruitsto github - create pull request to merge
feature/fruitsintomain
- create repo
-
Git diff and git stash:
- show the git diff when we make changes in current feature
- explain git stash
- show git diff (when there are no differences)
- explain git stash list and then git stash apply
- explain difference between git stash apply and git stash pop
- show some more options like git diff --stat
-
How to "remove" commits
- git reset soft vs. hard
- git revert
- git cherry-pick
- git rebase -i HEAD~N
-
Exercise to create commit use reset soft, and then create another commit use reset hard.
-
Show git checkout to a specific commit.
-
Random things that should be mentioned throughout the session:
git checkout -- <file>/git restore <file>(only works in git 2.23+)git reset HEAD <file>/git restore --staged <file>(only works in git 2.23+)git rm --cachedgit commit --amend- show how to check that local branch is up to date with origin (with git log)
-
How to write a good commit message.
-
How to create a good, easy to understand PR.