有没有办法通过运行一些 git
命令并检查其退出代码来判断文件是否正在被跟踪?
换句话说:git 是在跟踪一个文件吗?
最佳答案
尝试:
git ls-files --error-unmatch <file name>
如果文件未被跟踪,将以 1 退出
关于git - 如何判断文件是否被 git 跟踪(通过 shell 退出代码)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2405305/