Here is the scenario:
In my working directory, I have a number of files (let's call them A,B,C) that I've edited. I then ran git update-index --assume-unchanged
on those files. Now git status
returns blank. Good.
Now, if I do a git reset --hard
, the contents of the files A,B, and C, revert back to the contents before I've edited them and "assume-unchanged" them.
Is there a way to stop git from actually reverting files A,B, and C, and simply ignore them?
Thanks,
Ken
When the "assume unchanged" bit is on, the user promises not to change the file and allows Git to assume that the working tree file matches what is recorded in the index. If you want to change the working tree file, you need to unset the bit to tell Git.
git/index changed by windows. So it can only refresh the index and replace the . git/index file, which makes the next git status super fast and git status in windows very slow (because the windows system will refresh the index file again).
You can do:
git update-index --skip-worktree A
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With