【问题标题】:How can I make git add -p accept keystrokes without waiting for me to press Enter?如何让 git add -p 接受击键而不等待我按 Enter?
【发布时间】:2015-11-13 07:42:51
【问题描述】:

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】:

是的。将配置选项interactive.singlekey 设置为true

git config --global interactive.singlekey true

【讨论】:

  • 这将改变我的生活
  • documentation says 也需要 Perl 的 Term::ReadKey。试试apt-get install libterm-readkey-perl
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-09-26
  • 1970-01-01
  • 1970-01-01
  • 2012-07-17
  • 2012-11-21
  • 2017-11-20
  • 1970-01-01
相关资源
最近更新 更多