This question is from rest of other question because it asks why .gitignore is useful compared to git commands?
I have recently started using git using command line.
I created a local repo and created a file test.txt
inside this repo.
Command git status
tells me that test.txt
is a untracked file. Command git add test.txt
adds my file to be tracked. Then command git commit -m "message"
commits my tracked file.
My question is if i can already specify which files should be tracked and commit from commands then what is the use of .gitignore file? In which case should i use the .gitignore file?