How to do it...

Load Git GUI in the Git-Version-Control-Cookbook-Second-Edition_tips_and_tricks repository. Here, you can see the unstaged changes (files) at the top-left and the staged changes (files) underneath. The main window will display the unstaged changes in the current marked file. You can right-click on a hunk and see a context menu with options for staging and so on. The first hunk shown by Git GUI is much larger than what we saw before with git add -p. Choose Show Less Context to split the hunk, as shown in the following screenshot:

Now, we get a smaller hunk like before, as shown in the following screenshot:

For the first hunk, ...

Get Git Version Control Cookbook 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.