How can I make git add -p accept keystrokes without waiting for me to press Enter?

git add -p is very convenient for staging changes in an interactive fashion. At each change, it prompts the user to press a key to determine what Git should do with the change in question:

Stage this hunk [y,n,q,a,d,/,K,j,J,g,s,e,?]?

Is there anyway to make git move onto the next hunk without having to hit Enter?

  • Graphic added/deleted lines by user
  • Lost files after git read-tree
  • Bitbucket git LFS giving weird error message
  • A way to revert a whole branch in a single commit
  • How to remove deleted folder from remote repository in Git?
  • github access denied access for push
  • is git submodules what I need?
  • Git Hooks - post-merge hook file not exist
  • git svn ignore paths use ignore file
  • GitHub: invalid username or password
  • Created new branch from existing commits, now origin and origin/master are out of sync
  • Two git repos coexisting - not possible, or how?
  • One Solution collect form web for “How can I make git add -p accept keystrokes without waiting for me to press Enter?”

    Yes. Set the config option interactive.singlekey to true:

    git config --global interactive.singlekey true
    
    Git Baby is a git and github fan, let's start git clone.