process overview

  1. get latest main
  2. feature branch
  3. rebase feature as needed to main, likely nasty merge conflicts everywhere (likely they prefer squash all commits on a PR)

why?

you get a clean and organized by feature commit history. You get no merge commit artifacts

issues?

  • you can’t easily undo anything or see what happened if someone including you botches a rebase conflict “merge”
  • it is labor intensive to provide cleaner (in theory) output
  • common in large tech style monorepo approaches.

Gotchas:

get latest main, no git pull

You need the latest main to start a new feature branch. Do not use git pull

instead

git fetch origin
git checkout main # order here doesn't matter
git reset --hard origin/main

What this does.

fetch (get) the changes from the remote (all the things)

checkout (set the working branch to) main

git reset (set the local branch) —hard (overwrite all the things) origin/main (to the remote copy just fetched / gotten / get above)