无法使用 "Git add -i"

Can't use "Git add -i"

尝试将文件修补到最后一次提交,所以我 运行“git add -p”和“git add -i”,但收到以下错误:

即:

D:\Working\test>git add-i
      0 [main] perl 375 child_copy: stack write copy failed, 6xFFFFC480..8x10000000e, done 6444523849, windows pid 15080, Win32 error 5
      [main] perl 375 child_copy: stack write copy failed, exFFFFC480..9x1000eeeee, done 6444523049, windows pid 15880, Win32 error 5
    481 [main) perl 375 dofork: child 376 - pid 13800, exitval ex183, errno 11 
     Can't fork, trying again in 5 seconds at C:/Program Files/Git/ming64/share/per15/Git.pm line 1647.
     main) perl 375 dofork: child 377 pid 4888, exitval ex103, errno 11 Can't fork, trying again in 5 seconds at C:/Program Files/Git/mingw64/share/per15/Git.pm line 1647.

D:\Working\test>git add -p
    0 [main] perl 9 child_copy: stack write copy failed, exFFFFC460..ex1eeeeeeee, done 6444523849, windows pid 7892, Min32 error S ses [main] perl 9 dofork: child 10 pid 11876, exitval ex183, errno 11
    Can't fork, trying again in 5 seconds at C:/Program Files/Git/mingw64/share/per15/Git.pm line 1647. 5033325 [main] perl 9 child 
     copy: stack write copy failed, exFFFFC460..9x100000000, done 6444523849, windows pid 7892, Win32 error 5 5033826 [main] perl 9 dofork: child 11 - pid 12220, exitval ex103, errno 11 Can't fork, trying again in 5 seconds at C:/Program Files/Git/ming 64/share/per15/it.pm line 1647.

已尝试卸载并安装 Git,但问题仍然存在。

Thanks to comment of @torek, I managed to use the commands after installing Per

你不应该有。

  1. Git for Windows no longer use Perl for git add (mingw64/libexec/git-core/git-add.exe). This is 的最新版本。
  2. perl.exe 是 Windows 发行版的 Git 的一部分:确保您的 %PATH% 包含 C:\path\to\Git\usr\bin

Git到运行不需要安装Perl。


2年后(Q1 2022),随着Git 2.36(Q2 2022),单键C重写“git add -i"(man)还有收尾工作交互模式。

参见 commit 0f584de, commit 6606d99, commit e4938ce, commit 02af15d (16 Mar 2022) by Phillip Wood (phillipwood)
参见 commit 32f3ac2 (09 Mar 2022) by Junio C Hamano (gitster)
(由 Junio C Hamano -- gitster -- in commit d723492 合并,2022 年 3 月 30 日)

terminal: restore settings on SIGTSTP

Signed-off-by: Phillip Wood

If the user suspends git while it is waiting for a keypress reset the terminal before stopping and restore the settings when git resumes.
If the user tries to resume in the background print an error message (taking care to use async safe functions) before stopping again.
Ideally we would reprint the prompt for the user when git resumes but this patch just restarts the read().

The signal handler is established with sigaction() rather than using sigchain_push() as this allows us to control the signal mask when the handler is invoked and ensure SA_RESTART is used to restart the read() when resuming.