Git:忽略跟踪的文件 [英] Git: Ignore tracked files

查看:88
本文介绍了Git:忽略跟踪的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在存储库中有一些跟踪文件,这些文件在构建代码时会自动修改。我不想让他们失望,我只是不希望他们出现在修改中,我不希望他们在我添加git时被暂存。

I have some tracked files in a repository which are automatically modified when building the code. I don't want to untrack them, I just don't want them to appear as modified and I don't want them to be staged when I git add.

这可能吗?

推荐答案

当然。

Sure.

git update-index --assume-unchanged file

撤销并重新开始追踪:

git update-index --no-assume-unchanged [<file> ...]

这篇关于Git:忽略跟踪的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆