I have a Git repository that contains a .gitignore
file, which lists a few files (that are created during the build) to be ignored.
$ cat .gitignore
foo
$ ls
bar
$ git status
On branch master
nothing to commit, working directory clean
$ touch foo
$ ls
bar foo
$ git status
On branch master
nothing to commit, working directory clean
$
In a specific clone of that repository, I do want to see the files listed in .gitignore
.
This can be done with the --ignored
option to git status
:
$ git status
On branch master
nothing to commit, working directory clean
$ git status --ignored
On branch master
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
foo
nothing to commit, working directory clean
$
Nice. My question is: how can I make this permanent for a given repository, so that I do not have to remember to add the --ignored
flag?
$ git status
On branch master
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
foo
nothing to commit, working directory clean
$
I'm sure there is some git config
uration that allows me to configure my clone to ignore the contents of .gitignore
...
Also, I don't want to have this option for all repositories; only for a select few.