I just did the following to to keep a different copy of my config.php file in my localhost vs. my production environment:
$ git update-index --assume-unchanged application/config/config.php
Unfortunately, I didn't write the config.php file exactly as I should and I need to reverse this such that I can make the change, commit it, and then re-ignore the file.
How do I undo the git update-index
command?
To undo git add before a commit, run git reset <file> or git reset to unstage all changes.
So, to undo the reset, run git reset HEAD@{1} (or git reset d27924e ). If, on the other hand, you've run some other commands since then that update HEAD, the commit you want won't be at the top of the list, and you'll need to search through the reflog .
git update-index --no-assume-unchanged application/config/config.php
Notice the --no
prefix, stylistically a double negation.
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