git update-index --assume-unchanged <filename>
returns fatal: Unable to mark file <filename>
.
What do I need to do to fix this? What is it complaining about and why?
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.
--skip-worktree explained: This allows you to make changes to a file that you don't want to be pushed to upstream. Use this option as already shown above.
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
Is it added to the repository, not in .git/info/exclude
and not on .gitignore
?
If the answer is yes to either of those, then the file is not in the repository and this is the reason for the error.
Try git ls-files -o
and see if the file is there. It should not be.
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