Re: gitignore: how to exclude a directory tree from being ignored

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter schrieb:
> Hi
> I want to exclude binaries except in a dir tree that I do not control.
> 
> In .gitignore  I have:
> 
> 
> I would expect that all *.exe and *.o are ignored except those somewhere
> in the vendor dir tree.
> However, the *.exe and *.o in the vendor dir tree are also ignored.

This works for me:

 *.exe
 *.o
 !vendor/*.exe
 !vendor/*.o

Note that git-status does not descend into directories from which no files
are tracked. Therefore, this will work only after you have git-added at
least one file from vendor/.

git ls-files -o --exclude-standard does descend into the directory.

Furthermore, the !vendor/*.exe patterns are not recursive. Perhaps it is
easier for you to have a separate vendor/.gitignore that has:

 !*.exe
 !*.o

These _are_ recursive.

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]