I just created a new git repo at / I created a new filetest.txt in the folder test_fold so that the path to the file is test_fold\test.txt. I then run git status. This is the output, it finds the folder but not the file. Why is not showing me that there is a new file in test_fold?
$ git status On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) .gitignore test_fold/ nothing added to commit but untracked files present (use "git add" to track) The .gitignore file is blank.
Git will ignore the content of a folder if the folder doesn't already contain tracked paths. You know by the presence of test_fold/ that there are files in there (Git will never show you an empty directory as being untracked) and you know that those files are not tracked.
Otherwise, unzipping a folder into your repository could potentially introduce huge amounts of output from git status. The default behavior of simply showing the top-level untracked path makes for much saner output.
If you want Git to show you the content of the folder, use
$ git status -uall This will show you test_fold/test.txt (and any other files) instead of just test_fold/.
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