![]() | 1 livelazily 2016-08-01 08:39:05 +08:00 至少你得把那些附件文件放到 Build result 的某个子目录下,然后 .gitignore 里使用 !buildresult/resourcexxx 来排除忽略 如果是直接在 build result 下的话, 你就得一个一个加文件名排除 |
![]() | 2 wysnylc 2016-08-01 08:45:00 +08:00 shell 脚本 |
![]() | 3 x1155665 OP @livelazily 不能这么做。。因为母文件夹 build result 已经被排除了。 “ An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn ’ t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, "\!important!.txt" ” |
![]() | 4 livelazily 2016-08-01 19:04:28 +08:00 ![]() @x1155665 这样试试: 工程根目录.gitignore 文件不忽略 buildresult , buildresult 文件夹内再新建一个 .gitignore 文件, 内容: #ignore everything in this directory * # Except this dir !resourcexxx |
![]() | 5 x1155665 OP @livelazily 靠谱! 一些细节需要改一下: build result 文件夹里的 .gitignore 文件内容: #ignore everything in this directory * # Except this dir !resourcexxx/* 解释:/ 对于表示文件夹是必须的,/ 后面加 * 是为了让 resourcexxx 的子文件里的文件也可以被包括。 |