DEV Community

Discussion on: Stop tracking and start ignoring

Collapse
ferdnyc profile image
Frank Dana • Edited on

That's not why this happens. It happens because you're adding those files in the first place. Why are files you don't want to push even being tracked? git add is meant to be a targeted operation, performed only on those files you want in the repo. Don't git add * or (worse) git add -A and you won't have this problem.

Collapse
svijaykoushik profile image
Vijay Koushik, S. 👨🏽‍💻 Author

Thank you for sharing about git add command. Like I said in this comment, I use the GitHub Desktop app to commit and push my changes to the remote repo. Since It automatically adds all new files to the tracking list, The issue of committing unwanted files occurs when I'm not vigilant enough 😐.

Collapse
ferdnyc profile image
Frank Dana • Edited on

(I love .gitignore for its ability to hide things from the "Untracked Files" list in git status. Because if you're not planning on tracking those files, get them off the list so that git can warn you if you haven't added any that you SHOULD be tracking.)