views:

398

answers:

2

I was reading http://www.kernel.org/pub/software/scm/git/docs/gitignore.html and the 6 points used to explain the ignore patterns seem to be describing a custom variant of a glob search syntax. I am more familiar with Mercurial, which allows to explicitly ignore via glob or regex patterns, no questions asked.

  • Is there any similar functionality in Git?
  • Can anyone point me to some more exhaustive reference than the Git man page?

Best,
t

+1  A: 

There is no built-in way of excluding by regex. If there were, you'd see it on the man page.

Jefromi
As I mentioned in your previous answer http://stackoverflow.com/questions/2899875/git-add-not-working-with-png-files/2900049#2900049 (and as Chris Johnsen details in the same question), all pattern-based file selections are delegated to the `fnmatch()` function, isn't it.
VonC
A: 

Not exactly. It can be used a bash-like syntax where you can specify something like this:

*tmp_*~

which is the same as the regExp: .*tmp_.*~

Hope this will help you!

Andrea Salicetti