Learn Git Branching is an interactive git visualization and tutorial. The website contains multiple levels/tasks teaching different aspects of git. Each level starts with a goal and contains helpful instructions. The website features a fake command line for inputting git commands and an interactive git graph visualization, which shows the state of the repository in every step.
Oh My Git! is a cross-platform game showing how Git works. It offers a playing card style interface for new players and an integrated terminal for more advanced usages. It shows the Git repository as a graph and various manipulations are possible. Even interaction with remote repositories is implemented.
The game is implemented in Godot and available as open-source on GitHub.
The website describes bad situations in git and how to solve them.
Git is hard: screwing up is easy, and figuring out how to correct your mistakes is fucking impossible. Git documentation has this chicken-and-egg problem where you can't search for how to get yourself out of a mess, unless you already know the name of the thing you need to know about to resolve your problem.
The blog post explains gits feature of git commit --fixup
and how it interacts with autosquashing during rebase. It suggests to enable autosquashing in the gitconfig and offers a nice alias for git fixup
to make the selection of the fixup commit simpler.
[alias]
fixup = "!git log -n 50 --pretty=format:'%h %s' --no-merges | fzf | cut -c -7 | xargs -o git commit --fixup"
[rebase]
autosquash = true
Small script which makes it easier to check out GitHub pull requests and GitLab merge requests. The syntax is:
git pr 123 git pr 123 upstream
These websites provide templates for good .gitignore
files: