How to tell if a file is git tracked (by shell exit code)? September 19, 2022 by Tarik try: git ls-files --error-unmatch <file name> will exit with 1 if file is not tracked