本文介绍了git update-index --no-assume-unchanged不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在几个文件上设置了 assume-unchanged 位,现在我想取消它们,但这不起作用。

 > git update-index --no-assume-unchanged Gemfile 
> git ls-files -v | grep Gemfile
S Gemfile
S Gemfile.lock
> git status
#在分支foo
没有提交(工作目录干净)
>

我的Gemfile当然有变化。其中一些我不想承诺,另外一些我是。如果其他人更改Gemfile,我无法合并,因为那一点。它真的看起来有点太多了。



所以我有两个问题:

1:我该如何取消这个位?
2:是否有更好的方法可以忽略某个特定的本地变更,同时允许对该文件进行其他更改以正常工作?

解决方案 - 真正刷新标志

$ b $解决了这个问题b

像这样:

  git update-index --really-refresh --no-assume-不变Gemfile 

希望这适用于您



后期编辑:



如果您有多个文件,显然可以分两步完成

  git update-index --really-refresh 
git update-index --no-assume-unchanged Gemfile


I set the assume-unchanged bit on a couple of files, and now I want to unset them, but that doesn't work.

> git update-index --no-assume-unchanged Gemfile
> git ls-files -v | grep Gemfile
S Gemfile
S Gemfile.lock
> git status
# On branch foo
nothing to commit (working directory clean)
> 

I have changes in my Gemfile of course. Some of them I don't want to commit, others I do. And if anyone else changes Gemfile, I can't merge because of that bit. It really seems to mess a bit too much stuff up.

So I have two questions:

1: How do I unset the bit?2: Is there a better way to ignore one specific local change, while allowing other changes to that file to work normally?

解决方案

A bit late maybe but I was facing the same problem as you and I solved it by using the --really-refresh flag

like so :

git update-index  --really-refresh --no-assume-unchanged Gemfile

Hope this works for you

Post edit :

It can be done apparently in 2 steps if you have multiple files

 git update-index  --really-refresh
 git update-index --no-assume-unchanged Gemfile

这篇关于git update-index --no-assume-unchanged不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 14:09