English 中文(简体)
git Add -p -ignore-submodules?
原标题:git add -p --ignore-submodules?

www.un.org/Depts/DGACM/index_spanish.htm 在使用<条码>git 添加——发送<>/条码>时,是否有办法忽视dirty submodules?

I ve set ignore = dirty as explained here. This seems to only work with git status and git diff. I love git add -p. Having to skip through 10 dirty submodules every time I want to add a small change frustrates me.

我在<代码>git 后加——上的数字相当高,但它认为,它以同样的方式处理ir子。

问题回答

沉默地无视分层更新,似乎引证Clint, to 危险。

我不知道如何用添加——但我可以与增加——编辑和生动钥匙:

map <Leader>x :%!sed  /^diff --git/!{H;$!d};x;1{$!d;x};/
index[^
]*160000
/d <CR>

将绘制<代码>xx>/code>,以删除所有单元更新栏目。 The !s in that are vim-specific bang Xiaos, ne these reslashes to use the sed otherwise.

With Git 2.16.x/2.17, you won t even need a --ignore-submodules option,
since "git add -p" was taught to ignore local changes to submodules as they do not interfere with the partial addition of regular changes anyway.

See commit 12434ef (13 Jan 2018) by Nguyễn Thái Ngọc Duy (pclouds).
(Merged by Junio C Hamano -- gitster -- in commit e7e8077, 23 Jan 2018)

add--interactive: ignore submodule changes except HEAD

For add -i and add -p , the only action we can take on a dirty submodule entry is update the index with a new value from its HEAD.
The content changes inside (from its own index, untracked files...) do not matter, at least until git add -i learns about launching a new interactive add session inside a submodule.

Ignore all other submodules changes except HEAD.
This reduces the number of entries the user has to check through in git add -i , and the number of no they have to answer to git add -p when dirty submodules are present.





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...