Normally, you should see the file unless
- the folder holding the file is not yet added to the repo (in that case, you'll see only the folder when typing
git status
)
- the file is contained in a
.gitignore
present in the folder holding the file
- the file is contained in
.gitignore
- the file is contained in
.git/info/exclude
- the file is contained in your global
.gitignore
file (check with
git config --global core.excludesfile
)
To check whether your file is ignored by one of the ignore
files, type
git status --ignored
This will also show ignored files.
Solutions for the five cases:
- when the folder is not yet versioned, add it with
git add folder_name
. This will add the folder and all of it's files (unless they are ignored) to the index.
- when the file is filtered by a
.gitignore
, modify that file so that your file to be added shows up when typing git status
.