gpt4 book ai didi

git - `git add -p` 有哪些选项?

转载 作者:太空狗 更新时间:2023-10-29 13:29:31 25 4
gpt4 key购买 nike

执行 git add -p 我看到一个差异和选择列表:

~/workspace$ git add -p                                              
diff --git a/gulpfile.js b/gulpfile.js
index cf91028..c3a0964 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -57,7 +57,7 @@ gulp.task("pack", pack);
// Minify and concatenate all js libs
gulp.task("libs", function() {
return gulp.src([
- "js/libs/trackjs.js",
+ // "js/libs/trackjs.js", // hidden due to noise but not the bug
"js/libs/q.js",
"js/libs/jquery.js",
"js/libs/cookie.js",
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]?

Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? 选项是什么意思?在哪里可以找到他们的解释?

最佳答案

如果您在提示符下键入 ?,您会得到解释。

具体的选项有:

y - stage this hunk
n - do not stage this hunk
q - quit; do not stage this hunk or any of the remaining ones
a - stage this hunk and all later hunks in the file
d - do not stage this hunk or any of the later hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
J - leave this hunk undecided, see next hunk
k - leave this hunk undecided, see previous undecided hunk
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
? - print help

如果您遇到和我一样的困惑,我发现有时 j,J,k,K 选项不起作用,我认为(但我还没有没有足够的实验来确定)它们只在同一个文件中工作,所以你可以跳过同一个文件中的大块,但不能跳到下一个文件,然后返回到前一个文件。

关于git - `git add -p` 有哪些选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34527413/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com