1.忽略文件
git update-index --skip-worktree -- <file>
解释:<file>就是文件的地址,实际输入地址时,不需要将括号 <> 加入
2.查看忽略的文件
git ls-files -v | grep -i ^S
3.取消标志,恢复版本控制
git update-index --no-skip-worktree -- <file>
4.批量忽略文件
cd dir
git update-index --skip-worktree $(git ls-files | tr '\n' ' ')