我有一个包含有一些构建和配置文件的子树的仓库。
main
├── .gitignore
└── build (subtree)
├── .gitignore
└── config.user.json
└── config.site.json
└── index.js
我想忽略来自回购和子树config.user.json的,但保留在主回购中,但在子树中忽略它。mainbuild config.site.jsonbuild
主/.gitignore
!build/config.site.json # (this is supposed to reverse the ignore)
build/config.user.json
构建/.gitignore
build/config.site.json
build/config.user.json
这可能吗,或者我应该将我的配置文件放在与build. 我有一种感觉,子树中的 .gitignore 将覆盖主仓库中的 .gitignore,而不是相反。
REF:Git 子树特定忽略
干杯