Download Magit User Manual

Transcript
Chapter 9: Commit Buffer
10
9 Commit Buffer
When you view a commit (perhaps by selecting it in the log buffer, Chapter 7 [History],
page 8), the “commit buffer” is displayed, showing you information about the commit and
letting you interact with it.
By placing your cursor within the diff or hunk and typing a, you can apply the same
patch to your working copy. This is useful when you want to copy a change from another
branch, but don’t necessarily want to cherry-pick the whole commit.
By typing v you can apply the patch in reverse, removing all the lines that were added
and adding all the lines that were removed. This is a convenient way to remove a change
after determining that it introduced a bug.
If the commit message refers to any other commits in the repository by their unique
hash, the hash will be highlighted and you will be able to visit the referenced commit either
by clicking on it or by moving your cursor onto it and pressing RET.
The commit buffer maintains a history of the commits it has shown. After visiting a
referenced commit you can type C-c C-b to get back to where you came from. To go forward
in the history, type C-c C-f. There are also [back] and [forward] buttons at the bottom
of the buffer.