git假定不变的影响 [英] git assume-unchanged implications

查看:615
本文介绍了git假定不变的影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个 foo.bar 的文件,它被 git 跟踪,存储库忽略我对此文件所做的更改。这是,如果我理解正确,使用的情况下( link1 ; link2

Say I have a file foo.bar which is tracked by git and at some point I want my local repository to ignore the changes I make to this file. This is, if I understand correctly, the case to use (link1;link2)

git update-index --assume-unchanged foo.bar

我的问题是,如果远程存储库发生更改,该文件会发生什么情况?这些更改是否会反映在我的本地副本中?

My question is, what happens with this file in case there are changes on a remote repository? Will the changes be reflected in my local copy?

回答提出了同样的解决方案 - 但解决我的问题的评论没有回答...

This answer suggests the same solution - but the comment which address my question was left unanswered...

推荐答案

位存储在您的索引中,而不是储存库本身。因此, fetch / pull / push 不会传播该设置去往或来自其他储存库,这意味着它是一个本地设置。存储库其他克隆的用户可能很好地创建涉及该文件的新提交。我不确定关于如何处理这种情况有一个简单的答案,因为它取决于你想要做什么,以及在其他存储库中正在做什么。

The "assume-unchanged" bit is stored in your index, not in the repository itself. Thus fetch/pull/push do not propagate that setting to or from other repositories, which means it is a local setting. Users of other clones of the repository may very well create new commits involving that file. I'm not sure there's a "simple" answer regarding how to deal with this scenario, as it depends on what exactly you're trying to do, and what is being done in other repositories.

这篇关于git假定不变的影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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