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- My opinionated tips about Git
- How to use this Git Repo
- Git Hosting Providers
- `checkout` -> `switch` + `restore`
- One directory per PR
- Creating a PR easily
- `git diff` via Pager, not IDE
- How to Use Multiple Git Configs on One Computer
- `git diff main` vs `git diff origin/main`
- Merge upstream branch often
- Create a backup of a branch
- Squash PRs
- List branches
- Switch back to previous branch
- git stash
- Accidentally Commit on Branch `main`
- Restore a single file
- Restore interactively
- `git diff` of pull-request
- Show Changes to a single file
- Find removed code
- Find branch which contains a commit
- `gitk`
- I don't care much for git history
- rebase vs merge
- List all files
- Autocompletion
- Solving Conflicts with `meld`
- Solving Conflicts: Overview
- Misc: Search with Editor, not with your eyes
- Misc: ripgrep: recursive grep which respects .gitignore
- Misc: atuin
- git diff shows no changes?
- Automatically prune on fetch
- Pick some lines from another branch with `git difftool`
- pre-commit.com
- gitleaks via pre-commit
- Public `.envrc` file, private `.env` file
- Long branch names are fine
- GitHub: Tab width: 4
- GitHub: open PR in web UI
- GitHub: Play a sound when a CI job is finished
- GitHub: Keep Actions/Workflows simple
- VS Code: autoFetch
- Starship Prompt
- restore, revert, reset
- delete merged branches
- git bisect
- git bisect for lazy people
- Squash all commits into a single commit
- Empty commit
- Show one commit in difftool
- Resolve, take theirs
- git log over many git repos
- Merging some parts of a different branch
- Show change of merge commit
- cherry-pick -n
- parent branch / base branch
- Merge PR base branch into current branch
- Undelete a branch
- Taskfile stamp files per task name
- Git submodules
- Chain of branches: Add base branch to name of second branch
- History for selection
- Which line ignores a file?
- TODO
- More