【发布时间】:2021-04-14 19:27:24
【问题描述】:
我在 Windows 10 上安装了 Git Bash,我正在关注此视频 https://youtu.be/MIFQwHlEI9o?t=602 在 VSCode 中使用 git,他正在使用带有 -p 选项的结帐从提交中挑选片段:
$ git checkout 0903304 index.html -p
diff --git b/index.html a/index.html
index 3ebbb46..d95bb1a 100644
--- b/index.html
+++ a/index.html
@@ -10,6 +10,10 @@
<ul>
<li>Item one</li>
</ul>
+
+ <p>Paragraph one</p>
+ <h1>A title</h1>
+ <div><p>Some text</p></div>
</body>
</html>
\ No newline at end of file
Apply this hunk to index and worktree [y,n,q,a,d,e,?]
当我输入“e”时,文件会加载两个版本,并且我的光标会自动放置在编辑器中。进行更改并按 CTRL+S 保存后,我无法退出。我试过 q、ESC、CTRL+X、wq、:wq、:x!除了用“x”关闭文件之外没有任何作用,但是我得到了:
Your edited hunk does not apply. Edit again (saying "no" discards!) [y/n]? 0 [sig] bash 987! sigpacket::process: Suppressing signal 18 to win32 process (pid 6340)
【问题讨论】: