CHAPTER 8

image

Modifying the History

This chapter deals with the diverse commands that modify the structure of the revision graph. Sometimes you will need to merge three different revisions into one revision. At other times you may need the opposite operation: splitting a single commit into many separate commits. Whatever the case may be, keep in mind that git revisions are permanent. They never change. Once you have created a revision, there is no way to modify it. All you can do is to throw it away using the method presented in Recipes 3-12 and 5-4. Therefore, whenever I say something like “let’s modify a revision,” the operation I have in mind ...

Get Git Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.