Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有可能
foo/
在 .gitignore 但不要忽略
bar/foo
不加
!bar/foo
到 .gitignore
改为使用/foo/,/匹配路径的开头。从gitignore手册页:
/foo/
/
前导斜杠匹配路径名的开头。例如,“/*.c”匹配“cat-file.c”但不匹配“mozilla-sha1/sha1.c”。