I'm curious if I run git update-index --assume-unchanged
, and somebody chages that file in a way that produces a conflict, what happens, if I pull those changes? Do I get a simple conflict? Does it overwrite my changes, since it assumes the file is not changed?
Asked
Active
Viewed 119 times
0

Tamás Barta
- 1,617
- 1
- 19
- 23
1 Answers
1
This is fairly easy to test. With Git 1.9.1 on my Linux machine, Git detects that such changes would be lost and prevents that from happening:
$ git pull
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From file:///XXXXXXX
493134f..d04cb06 master -> origin/master
Updating 493134f..d04cb06
error: Your local changes to the following files would be overwritten by merge:
foo.bar
Please, commit your changes or stash them before you can merge.
Aborting
As a side note, I recommend avoiding git update-index
if you can, as it was not designed with end users in mind.

ChrisGPT was on strike
- 127,765
- 105
- 273
- 257
-
Very good answer, I like your note at the end. I also use it very few, and only when I use Git in combination of bad team cooperation and SVN. :D – Tamás Barta Oct 14 '14 at 11:23