I have quite many files that I set as
git update-index --assume-unchanged <file>
In some cases my branch is messed up and diverged with origin/master. Let's say
and have 4 and 8 different commits each, respectively.
So I want to revert all my commits and keep update to origin/master while keeps my assume-unchanged files not being flushed. How can I do this?
Instead of using
--assume-unchanged
, you can try--skip-worktree
withgit update-index
.A file with the flag
git update-index --skip-worktree
should resist agit reset
(which would unstage from the index any added changes)You can see a full analysis of the differences between
--assume-unchanged
and--skip-worktree
here.