Git Tips

Generated from README.md. Each heading becomes a page, with quick keyboard navigation for reading.

PageDown x2 jumps to the next slide. PageUp x2 goes back. Home keeps you on this index.

Start Reading
  1. My opinionated tips about GitSlide 1
  2. How to use this Git RepoSlide 2
  3. Git Hosting ProvidersSlide 3
  4. `checkout` -> `switch` + `restore`Slide 4
  5. One directory per PRSlide 5
  6. Creating a PR easilySlide 6
  7. `git diff` via Pager, not IDESlide 7
  8. How to Use Multiple Git Configs on One ComputerSlide 8
  9. `git diff main` vs `git diff origin/main`Slide 9
  10. Merge upstream branch oftenSlide 10
  11. Create a backup of a branchSlide 11
  12. Squash PRsSlide 12
  13. List branchesSlide 13
  14. Switch back to previous branchSlide 14
  15. git stashSlide 15
  16. Accidentally Commit on Branch `main`Slide 16
  17. Restore a single fileSlide 17
  18. Restore interactivelySlide 18
  19. `git diff` of pull-requestSlide 19
  20. Show Changes to a single fileSlide 20
  21. Find removed codeSlide 21
  22. Find branch which contains a commitSlide 22
  23. `gitk`Slide 23
  24. I don't care much for git historySlide 24
  25. rebase vs mergeSlide 25
  26. List all filesSlide 26
  27. AutocompletionSlide 27
  28. Solving Conflicts with `meld`Slide 28
  29. Solving Conflicts: OverviewSlide 29
  30. Misc: Search with Editor, not with your eyesSlide 30
  31. Misc: ripgrep: recursive grep which respects .gitignoreSlide 31
  32. Misc: atuinSlide 32
  33. git diff shows no changes?Slide 33
  34. Automatically prune on fetchSlide 34
  35. Pick some lines from another branch with `git difftool`Slide 35
  36. pre-commit.comSlide 36
  37. gitleaks via pre-commitSlide 37
  38. Public `.envrc` file, private `.env` fileSlide 38
  39. Long branch names are fineSlide 39
  40. GitHub: Tab width: 4Slide 40
  41. GitHub: open PR in web UISlide 41
  42. GitHub: Play a sound when a CI job is finishedSlide 42
  43. GitHub: Keep Actions/Workflows simpleSlide 43
  44. VS Code: autoFetchSlide 44
  45. Starship PromptSlide 45
  46. restore, revert, resetSlide 46
  47. delete merged branchesSlide 47
  48. git bisectSlide 48
  49. git bisect for lazy peopleSlide 49
  50. Squash all commits into a single commitSlide 50
  51. Empty commitSlide 51
  52. Show one commit in difftoolSlide 52
  53. Resolve, take theirsSlide 53
  54. git log over many git reposSlide 54
  55. Merging some parts of a different branchSlide 55
  56. Show change of merge commitSlide 56
  57. cherry-pick -nSlide 57
  58. parent branch / base branchSlide 58
  59. Merge PR base branch into current branchSlide 59
  60. Undelete a branchSlide 60
  61. Taskfile stamp files per task nameSlide 61
  62. Git submodulesSlide 62
  63. Chain of branches: Add base branch to name of second branchSlide 63
  64. History for selectionSlide 64
  65. Which line ignores a file?Slide 65
  66. TODOSlide 66
  67. MoreSlide 67