When I run git status
, I see the "Untracked files" section has many files (some with a "." extension.)
I don't think I have to do anything, but it doesnt look good to see these files whenever I run git status
. Is there any way to not to see these files?
The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area.
Use your favorite text editor to open the file called . git/info/exclude within the root of your Git repository. Any rule you add here will not be checked in, and will only ignore files for your local repository.
gitignore file is showing up on the status, because it's untracked, and git sees it as a tasty new file to eat! Since . gitignore is an untracked file however, it is a candidate to be ignored by git when you put it in . gitignore!
Files that are "yours", files that no one else sees, write in .git/info/exclude.
For files that everyone else sees, write them down in .gitignore at the project top directory and then add and commit the .gitignore file.
For example, your .gitignore might look like so:
*.o
.*.sw[op]
*~
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