Repository navigation
|
Hi everybody! I'm trying to switch from gitui to gitu, but, I'm kind of stuck when I have to go hunk by hunk and add/discard lines from a hunk (a smaller hunk). Any ideas how to achieve that? |
Replies: 1 comment 1 reply
|
Gitu does this from the status screen. What you act on depends on where the cursor is: a file, a hunk, or a single line.
So for a hunk: put the cursor on the hunk in "Unstaged changes", press For a single line: on the hunk, press
I checked all six cases (stage, unstage and discard, for a hunk and for one line) on v0.43.0 in a scratch repo, verifying each with Default keys: https://github.com/altsem/gitu/blob/master/src/default_config.toml Is the |
Gitu does this from the status screen. What you act on depends on where the cursor is: a file, a hunk, or a single line.
j/kmove between sections, files and hunks.Tabexpands a file to show its hunks.ctrl+j/ctrl+k(orctrl+down/ctrl+up) move one diff line at a time inside a hunk. They skip the context lines and stop on the+/-lines.sstages,uunstages,Kdiscards whatever is under the cursor.So for a hunk: put the cursor on the hunk in "Unstaged changes", press
s. To take it back, go to it under "Staged changes" and pressu.For a single line: on the hunk, press
ctrl+juntil the line you want is highlighted, thens(oruin the staged section,Kto drop it from the working tree).…