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,
If
git ls-filesshowssource.c, then it must already be in the index. This means that it is already tracked, and possibly already committed. Ifsource.cisn’t showing up ingit statusat all, then the file must have been committed.Try modifying the file to see if it shows up as modified in
git status. To really convince yourself that the file is checked in, rungit cat-file -p HEAD:source.cto see the contents of the checked-in file (seegit help revisionsfor documentation about theHEAD:source.csyntax).In addition, one or more of the following may be true:
git ls-files -v source.c. If the first column is a lower-case letter, then the ‘assume unchanged’ bit is set. This will prevent any changes from showing up ingit status. You can turn off the ‘assume unchanged’ bit by runninggit update-index --no-assume-unchanged source.c.git ls-files -v source.cissorSthen the ‘skip-worktree’ bit is set. You can turn off the ‘skip-worktree’ bit by runninggit update-index --no-skip-worktree source.c..git/index(Git will recreate it as necessary).stat()from working properly. Try runninggit update-index --really-refresh. If your working directory is on a network drive (NFS, sshfs, etc.) try moving your repository to a local drive.