In Git, how do I tell if a file or folder is committed versus ignored?
That is, I have a folder in the current directory and I don't know if it's been committed, or, if there's a .gitignore somewhere that is ignoring the folder. When I do 'git status' the folder is not listed in any sections.
Secondly, if the folder has been committed, is there an easy way to tell which of its files are committed? For example:
folder contains:
- 0001.csv
- 0002.csv
- ...
- 2000.csv
And I want to list which files have been committed, and which have been ignored.
Are you looking for
git status --ignored
?
That will show a result that looks like:
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)(all added / modified)
Ignored files:
(use "git add -f ..." to include in what will be committed)(all ignored files)
I think you're looking for git status --ignored
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With