This blog will explain the methods to show untracked files that do not exist in the “.gitignore” file/folder.
How to Git Show/Display Untracked Files That Do Not Exist in .gitignore File/Folder?
Different Git commands are available to display untracked files that are not present in .gitignore, such as:
Method 1: Show Untracked Files Using “git status -u” Command
To display only the untracked files that do not exist in .gitignore, run the “git status” command with the “-u” option:
The below output indicates that there are two “Test1.txt” and “Test2.txt” untracked files:
Method 2: Show Untracked Files Using “git ls-files . –exclude-standard –others” Command
Enter the following command to list the untracked files in the repository:
It can be seen that the above-stated command has displayed the untracked files that do not exist in the “.gitignore” file/folder:
We have explained two methods to display untracked files that do not exist in the .gitignore file/folder.
Conclusion
To show/display untracked files that are not present in .gitignore, different Git commands can be used, such as the “git status -u” and “git ls-files . –exclude-standard –others” commands. This blog explained the methods to display untracked files that do not exist in the “.gitignore” file/folder.