-2

How do i force git status to show all untracked files instead of just showing "./" ?

For context, i created two new files: server.py and requirements.txt. I thought git status will list all new file as usual, but what happened is that git only shows "./" instead of listing all untracked file.

enter image description here

From the answers at How do you git show untracked files that do not exist in .gitignore , i can show all the files with the command git ls-files . --exclude-standard --others

enter image description here

This is very inconvenient, because i had to run two command instead of just git status. I wonder what causes git status to only show "./" instead of listing all the untracked file? Is there any way to force git status to list all untracked files ?

LLL
  • 229
  • 2
  • 13
  • 1
    https://git-scm.com/docs/git-config#Documentation/git-config.txt-statusshowUntrackedFiles Since you always want this behavior, the correct approach is to use `git config` to set `status.showUntrackedFiles` to all. Example: `git config --global status.showUntrackedFiles all` That way, simply saying `git status` will always do what you want. Note however that this behavior (no matter how you ask for it) is expensive, as explained by the docs. You will perhaps find that `git status` is a lot slower. – matt Mar 31 '23 at 02:11

1 Answers1

0

Try modifying the command like this: git status --untracked-files=all

Muhammed Jaseem
  • 782
  • 6
  • 18