All about Git

Difftastic — Git integration

https://difftastic.wilfred.me.uk/git.html

diff | difftastic | git | tool

Difftastic can be used as Git's external diff or as a difftool. For one-off use run git -c diff.external=difft diff, git -c diff.external=difft show --ext-diff, or git -c diff.external=difft log -p --ext-diff.

For regular use the manual recommends git aliases (examples: ddiff, dshow, dlog, dl, ds, dft) or setting Difftastic as the default by adding

[diff]
    external = difft

to ~/.gitconfig. Use --no-ext-diff to opt out per command.

Alternatively, configure Difftastic as a difftool (the page shows a cmd snippet) — difftool passes extra metadata (permissions, renames) to Difftastic and is safer on older Git versions.

The manual includes gitconfig snippets, recommended aliases, and usage examples.


Learn Git Branching

https://learngitbranching.js.org/

Git | Tutorial

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!

https://ohmygit.org/

Game | Git

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.


Oh shit, git!

https://ohshitgit.com/

Cheatsheet | Git

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.


git commit --fixup and git rebase --autosquash

https://jordanelver.co.uk/blog/2020/06/04/fixing-commits-with-git-commit-fixup-and-git-rebase-autosquash/

Git

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