Re: Beginner problem with .gitignore

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

 



 > The problem is the recursive way in which git applies those patterns.
Your patterns above mean that git never recurses into the subdirs.

In the example above, you probably want

/a_dir/b_dir/*
!/a_dir/b_dir/c_dir/

Ok, I see. But that way would not ignore other directories in a_dir beside b_dir. For that task I have to use the following in .gitignore:

/a_dir/*
!/a_dir/b_dir/
/a_dir/b_dir/*
!/a_dir/b_dir/c_dir/

This tends to a quite bloated .gitignore when you have a deep directory structure and don't want to ignore all subfolders. I also took a brief look into Mercurial and in my opinion the .hgignore is more straightforward. It seems to use regexp on the complete file path to find out if the files that should be ignored. So the above four lines can be combined to one (and if the directory structure would be deeper, it would also be just a one liner). I know that there for sure is a reason for why git uses it's pattern in .gitignore (probably a performance thing). But it would be nice to have at least an option that it recurses into subdiretories, or uses regexp syntax on the whole file path. Just my two cents.

Best regards,
Kai

--
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]