git rebaseis one of two primary ways you can integrate changes from one branch onto another. The other isgit mergegit mergeis forward moving, that is, it keeps track of integrated changes as a merge commitgit rebasehas rewriting features that help keep logs "clean" and keep a linear project historywhy would you want a clean project history?
- easier to reason about project history
- allows
git bisectto more quickly identify when a bug was introduced
common way to integrate upstream changes into your local, downstream repository
git rebasewill take commits in your working branch and apply them to the head of the passed branchgit rebase --iopens an interactive console that allows you rewrite historyfeatures
- pick a commit
- reword a commit
- edit a commit (change both the message and the content)
- squash commit
- fixup
- exec
- drop (remove commit)
References
https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase