Summary
This chapter, along with Chapter 8, Advanced Branching Techniques, provided all the tools required to manage a clean, readable, and easy-to-review history of a project.
You learned how to make history cleaner by rewriting it in this chapter. You also learned what rewriting history means in Git, when and why to avoid it, and how to recover from an untimely upstream rewrite. You have learned to use an interactive rebase to delete, reorder, squash and split commits, and how to test each commit during the rebase. You know how to do a large-scale scripted rewrite with filter-repo
, as well as how to edit commits and commit metadata and how to permanently change history, such as by splitting it in two. You also got to know some third-party external tools, which can help with these tasks.
You learned what to do if you cannot rewrite history: how to fix mistakes by creating commits with appropriate changes (for example, with git revert
), how to add extra information to the existing...