Is there a way to tell if a file is being tracked by running some git command and checking its exit code?
git
In other words: is git tracking a file?
try:
git ls-files --error-unmatch <file name>
will exit with 1 if file is not tracked
1.4m articles
1.4m replys
5 comments
56.9k users