🧰 Core Tech Refresher
Git Workflow
Rebase vs merge, cherry-pick, when each is appropriate.
Merge preserves full history including the branch structure (a merge commit with two parents); rebase replays your commits on top of the target branch, producing linear history but rewriting commit hashes — never rebase commits that have already been pushed and could be in someone else's history.
Cherry-pick applies one specific commit from elsewhere onto your current branch — useful for hotfixes that need to land on both a release branch and main.
A reasonable position to state out loud: feature branches rebase onto main before opening a PR (clean, linear history for review), and the merge into main itself uses a merge commit or squash-merge depending on team convention.
Flashcards (2)
What's the practical risk of rebasing commits that have already been pushed/shared?
tap to reveal answer
What is
git cherry-pick for?tap to reveal answer