git check-ignore
Use git check-ignore to debug your gitignore file (exclude files).
For example:
$ git check-ignore -v config.php .gitignore:2:src config.php
The above matching pattern information (if any) for each given path name (including string).
So, perhaps your file extension is not ignored, but the entire directory.
Return format:
<source> <COLON> <linenum> <COLON> <pattern> <HT> <pathname>
Or use the following command to print .gitignore in the HOME user folder and repository folder:
cat ~/.gitignore "$(git rev-parse --show-toplevel)"/.gitignore "$(git rev-parse --show-toplevel)"/.git/info/exclude
Alternatively, use git add -f , which allows you to add otherwise ignored files.
See man gitignore , man git-check-ignore more details.
Syntax
git check-ignore [options] pathname ...
git check-ignore [options] --stdin
kenorb Mar 07 '15 at 19:12 2015-03-07 19:12
source share