首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我可以修改git-add的块大小吗?

我可以修改git-add的块大小吗?
EN

Stack Overflow用户
提问于 2009-07-13 21:34:28
回答 2查看 4.7K关注 0票数 29

我有一个我一直在处理的文件,然后意识到在我一直在工作的地方上面几行的地方我有一个错误。我很快修复了这个错误,并希望在我完成剩下的工作之前提交它。很好,这就是git add --patch的用武之地!

除了,我只看到了一个合并了这两个变化的大块头。有没有可能手动告诉git我想要两个大块头?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2009-07-13 21:36:00

除了“y”和“n”之外,当它问你关于一个大块头的问题时,你可以给出的一个答案是“s”,意思是“把这个大块头分成小块”。完整列表:

代码语言:javascript
运行
复制
y - stage this hunk
n - do not stage this hunk
q - quit, do not stage this hunk nor any of the remaining ones
a - stage this and all the remaining hunks in the file
d - do not stage this hunk nor any of the remaining 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
票数 48
EN

Stack Overflow用户

发布于 2009-07-14 06:57:30

git gui将允许您提交单个行,即使它们被您不想提交的其他修改过的行包围。

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

https://stackoverflow.com/questions/1122210

复制
相关文章

相似问题

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