I have used the following command to add a file to the repository with some default settings, then change the settings locally without pushing them to the repo every single time:
git update-index --assume-unchanged <filepath>
Now I need to push my local changes to the repo so I would need to undo this command. How would I be able to do this?
Note: I am aware that deleting the repo and then cloning it again would undo this and I have a wild guess that git reset --hard
would also work but I have multiple files that are in the same situation and executing the above command to have git ignore them again is just not feasible. Therefore I'm looking for a command that would only affect that specific file.
In order to set "assume unchanged" bit, use --assume-unchanged option. To unset, use --no-assume-unchanged .
You can type git update-index --assume-unchanged <file> to temporarily exclude the file from any tracking, pretending it never changed. And when you actually need to commit some actual change to the file you can use the opposite command git update-index --no-assume-unchanged <file> .
The DROP INDEX command is used to delete an index in a table.
The "index" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as the contents of the next commit. Thus after making any changes to the working tree, and before running the commit command, you must use the add command to add any new or modified files to the index.
To turn off the assume unchanged bit:
git update-index --no-assume-unchanged <filepath>
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