combining branches — merge, rebase, cherry-pick
git merge feature/my-thingmerges the target branch into the current one. creates a merge commit. fine for most cases, leaves the history a bit messy.
git rebase mainreplays your commits on top of main. keeps history linear. good for keeping feature branches up to date before opening a PR.
# typical rebase flow
git switch feature/my-thing
git fetch origin
git rebase origin/maingit rebase --abortbails out of a rebase mid-way if things go sideways. puts you back where you started.
git cherry-pick abc1234applies a single commit from another branch onto your current branch. useful when you just need one specific fix without merging the whole branch.