Git Collaboration Basics (2)
Rebase for clean history Interactive rebase Reorder, squash, or rewrite a range of commits: git rebase -i HEAD~5 Common directives: pick: keep the commit reword: edit the message squash: merge into the previous commit edit: pause to adjust content Resolve conflicts and continue git status # fix conflict markers <<<<<<< ======= >>>>>>> git add <resolved-file> git rebase --continue git rebase --abort Coordinate with the team Rewriting shared history requires coordination. Prefer git push --force-with-lease to avoid overwriting teammates’ work. ...