/git-rebase-example

Drop the bass with git rebase

Primary LanguageShellThe UnlicenseUnlicense

git-rebase-example

Dropping the bass with git rebase.

Art from The Git Rebase Introduction I Wish I Had

The plan

Dive right in!

  1. Merging main into our feature branch vs rebasing main
    • What about conflicts?!?
  2. Simple amending of commits with git commit --amend
  3. Fixup, squash, reword, and delete our garbage commits with git rebase -i
    • Reminder: drop the bass
  4. A word about git push's --force vs --force-with-lease
  5. 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
      
  6. Rebase fearlessly with git reflog
  7. Branching off branches, keeping up with rebasing, parent branch gets merged to main, and what now? git rebase --onto ftw
  8. Rebasing Etiquette, or: How to Not Make People Hate You

Links