Cannot see new files added to my git working directory

Viewed 110699

git version 1.7.4.1

I am using git on Ubuntu.

I have copied some files from another directory to my git working directory. Normally would appear under Untracked files. However, they do not appear. So I cannot add them.

When I do a git status the new files are not shown.

I tried to add them by doing git add source.c then tried git status. The file was not show.

So I opened the file and did a save as as the same name. git status still failed to see the file.

I have done a git ls-files and the new files are shown ok.

I have checked the file permissions and they are the same as all the current files in my git directory.

I have never had this problem before.

Many thanks for any suggestions,

10 Answers

It is most likely ignored by your .gitignore file.

Call git status --ignored and see if your file appears.

Android Repo - Same problem i faced- Corrected as below

Somehow i added "/app" in .gitignore file. Now after deleting "/app" it worked.

Please check your .gitignore.

git config --global status.showuntrackedfiles all - Resolution for an old case. You can use git status untracked-files=all in the terminal, but it is longer if set --global, the code above, it will only need,git status for files appear in the untracked location.

Related