Amending commits Git


show more Amending commits provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training show less
please wait ...

Amending commits

In the first movie of this chapter we saw how to undo changes to the working directory. In the second movie we saw how to undo changes that we've made to the staging index. Well, what about undoing changes that we've made to the repository itself, undoing commits that we've made? Well, that becomes a lot trickier. If you remember when we're talking about how Git refers to commits, and we talked about that it generates a hash value for all of the data that's put in there. The snapshot of all the changes as well as the information about it, the parent, the author, the message, et cetera. All that metadata all goes together into the algorithm to generate its hash.

If we change any of that information, well then the hash changes. That's part of the built-in security and data integrity of Git is that nothing can change in the history. We are guaranteed that everything must be the same. Well, that makes it hard to go back and edit information in those commits, because what we'r...

Amending commits
Video duration: 4m 50s 6h 25m Beginner

Viewers:

Amending commits provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training

Subject:
Developer
Software:
Git GitHub
Author:
please wait ...