Summary
In this chapter, we looked at a few advanced topics:
- Rebasing
- Amending
- Cherry-picking
What all three of these have in common is that they all rewrite history. Rebasing does so by copying all the commits of one branch onto the tip of another. Amending does so by allowing you to add files and/or change the message on a commit. Finally, cherry-picking acts like rebasing, but using just one or a few commits.
You saw that many of these activities are easier in Visual Studio but that some things you want to do are much clearer at the command line.
Finally, we explained why you merge into main, but you rebase onto main.