Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 208
Anthony Naddeo Avatar asked Aug 19 '15 20:08

Anthony Naddeo


People also ask

How do you hit enter in CMD?

Press Win + R to open the Run box, then type "cmd" and hit Enter to open it. Press Win + X (or right-click the Start button) and choose Command Prompt from the menu. Depending on your Windows settings, this may show Windows PowerShell or Windows Terminal instead.

Why does command prompt get stuck?

The issue ended up being a new feature of the windows 10 console. Under the default config, whenever you click on a command window in windows 10, it immediately halts the application process when it attempts to write to the console.


1 Answers

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

git config --global interactive.singlekey true
like image 153
mipadi Avatar answered Sep 23 '22 17:09

mipadi