Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undoing git update-index --assume-unchanged

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.

like image 929
Vlad Schnakovszki Avatar asked Aug 29 '15 14:08

Vlad Schnakovszki


People also ask

How do you undo an assume unchanged?

In order to set "assume unchanged" bit, use --assume-unchanged option. To unset, use --no-assume-unchanged .

What is assume unchanged in Git?

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> .

What command is used to take a change out of the index?

The DROP INDEX command is used to delete an index in a table.

How do you include a new file to your Git index?

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.


1 Answers

To turn off the assume unchanged bit:

git update-index --no-assume-unchanged <filepath>
like image 193
Edward Thomson Avatar answered Sep 22 '22 10:09

Edward Thomson