5

I’m looking for a particular string in a git repository, but I’d like my git log -Swhatever -p results to exclude any changes made to anything CSS related, e.g. any file with a file extension of .css or .scss

Is there a filter option or something in git log that I’m missing?

So far I’ve got git log -Swhatever -p -- '*.erb' '*.rb' '*.coffee' '*.js' as likely suspects for “other kinds of file extensions where my string might be” but I bet I’m going to miss some file extensions.

Edward Ocampo-Gooding
  • 2,782
  • 1
  • 23
  • 29
  • 2
    Probable duplicate: http://stackoverflow.com/q/25362738/1256452 (note in the answer that `:exclude` was broken until recently). – torek Jan 14 '15 at 22:38

1 Answers1

4

@torek is right!

The way to do this is as simple as:

git log -Swhatever -p -- . ':(exclude)*.css' ':(exclude)*.scss'

Edward Ocampo-Gooding
  • 2,782
  • 1
  • 23
  • 29