首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“`git添加-p`”的选项是什么?

“`git添加-p`”的选项是什么?
EN

Stack Overflow用户
提问于 2015-12-30 10:13:55
回答 1查看 5.3K关注 0票数 16

在做git add -p时,我看到了一个差异和选择列表:

代码语言:javascript
复制
~/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,?]?选项意味着什么?哪里能找到他们的解释?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-30 10:15:39

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

具体而言,备选办法是:

代码语言:javascript
复制
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选项不起作用,我认为(但还没有进行足够的实验来确定)它们只在同一个文件中工作,所以您可以跳过同一个文件中的大堆,而不是跳到下一个文件,然后返回到前一个文件。

票数 26
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34527413

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档