Sunday, April 14, 2013

Cygwin bash: inspect the contents of .gitignore files

When git complained
The following path is ignored by one of your .gitignore files:puppet/modules/postgresql
it neglected to tell me which file. I used bash find to search all of the .gitignore files in my project:
$ find . -name .gitignore -print -exec cat '{}' \;
./.gitignore
.vagrant
./puppet/modules/apt/.gitignore
*.swp
pkg/
Gemfile.lock
./puppet/modules/mysql/.gitignore
*.swp
pkg/
./puppet/modules/stdlib/.gitignore
pkg/
.DS_Store
metadata.json
coverage/
Gemfile.lock
.bundle/
vendor/bundle/
The "-print" option produces the file path, then the "-exec" option calls the "cat" command to dump the contents of the file, passing the file path to cat in the '{}' argument.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.