如何让 git add -p 接受击键而不等待我按 Enter?

问题描述 投票:0回答:1

git add -p
对于以交互方式进行更改非常方便。每次更改时,它都会提示用户按一个键来确定 Git 应如何处理相关更改:

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

有没有办法让 git 移动到下一个块而不必按 Enter

git interactive git-add
1个回答
16
投票

是的。将配置选项

interactive.singlekey
设置为
true
:

git config --global interactive.singlekey true

此外,请确保已安装

libterm-readkey-perl

© www.soinside.com 2019 - 2024. All rights reserved.