Dropping the bass with git rebase.
Art from The Git Rebase Introduction I Wish I HadDive right in!
- Merging
main
into our feature branch vs rebasingmain
- What about conflicts?!?
- Simple amending of commits with
git commit --amend
- Fixup, squash, reword, and delete our garbage commits with
git rebase -i
- Reminder: drop the bass
- A word about
git push
's--force
vs--force-with-lease
- Survival tip: assume everyone is a secret rebaser & force pusher
git pull --rebase origin/the-branch
git config --global pull.rebase true
, or in.gitconfig
:[pull] rebase = true
- Rebase fearlessly with
git reflog
- Branching off branches, keeping up with rebasing, parent branch gets merged
to
main
, and what now?git rebase --onto
ftw - Rebasing Etiquette, or: How to Not Make People Hate You
- https://git-scm.com/docs/git-rebase
- https://git-scm.com/book/en/v2/Git-Branching-Rebasing
- https://docs.github.com/en/get-started/using-git/about-git-rebase
- https://jvns.ca/blog/2023/11/06/rebasing-what-can-go-wrong-/
- https://git-scm.com/docs/git-reflog
- https://git-scm.com/docs/git-push
- https://git-scm.com/docs/git-pull
- https://git-scm.com/docs/git-commit