使用git,临时从命令行中提交排除已更改的跟踪文件 [英] With git, temporary exclude a changed tracked file from commit in command line
本文介绍了使用git,临时从命令行中提交排除已更改的跟踪文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在git中有一个已跟踪的数据库(已添加)文件。我希望这个文件始终在我的git仓库中包含相同的数据。即使我在工作副本(本地沙箱)中修改它以用于测试目的。
使用git,如何从我的工作副本中排除这个已更改的文件?
解决方案
忽略某些已经提交的文件的方式是
git update-index --assume-不变的文件
然而,这是一个本地设置,克隆时它不会传播。 p>
其效果被取消,git update-index --no-assume-gui
。
I have a tracked database (already added) file in git. I want this file to always contain the same data in my git repository. Even when I modify it in the working copy (local sandbox) for test purposes.
With git, how to exclude this changed file on my working copy from a commit ?
解决方案
The way to ignore certain files that are already committed is
git update-index --assume-unchanged file
However, this is a local setting, and it doesn't propagate when cloning.
Its effect is canceled with git update-index --no-assume-unchanged gui
.
这篇关于使用git,临时从命令行中提交排除已更改的跟踪文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文