Skip to content
Discussion options

You must be logged in to vote

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/k move between sections, files and hunks. Tab expands a file to show its hunks.
  • ctrl+j/ctrl+k (or ctrl+down/ctrl+up) move one diff line at a time inside a hunk. They skip the context lines and stop on the +/- lines.
  • s stages, u unstages, K discards 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 press u.

For a single line: on the hunk, press ctrl+j until the line you want is highlighted, then s (or u in the staged section, K to drop it from the working tree).…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@well1791
Comment options

Answer selected by well1791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants