怎么忽略git submodules里的更改

2,764 阅读1分钟

总结就是修改.gitmodules文件,加入ignore描述

ignore = dirty

eg:
[submodule "src/common"]
	path = src/common
	url = git@123.123.123.123:webapps/common.git
	ignore = dirty

  • dirty

    Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown

  • untracked

    When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content).

  • all

    Using "all" hides all changes to submodules (and suppresses the output of submodule summaries when the config option status.submodulesummary is set).

来自: www.nils-haldenwang.de/frameworks-…