Similar questions have been asked here, but I believe this particular one hasn't.
I have a file params.dat
that stores some parameter values for my code.
This file is constantly changing, since I change the parameter values often, so I added a static version of it into my repo at home along with the rest of the code, and then ignored it with:
git update-index --assume-unchanged params.dat
Everything works fine, except when I have to make some change to the static version of the file (which happens no so often). What I do is, first un-ignore it with:
git update-index --no-assume-unchanged params.dat
then make the necessary changes, commit and push them to Github and finally ignore the file again.
This works flawlessly with my main repo, but when I try to git pull
from the repo I keep at work, I get:
error: Your local changes to the following files would be overwritten by merge:
params.dat
Please, commit your changes or stash them before you can merge.
Aborting
I tried, as explained here, to do:
git fetch --all
git reset --hard origin/master
but I get:
error: Entry 'params.dat' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'origin/master'.
I also tried:
git stash
git merge origin/master
git stash pop
as stated here, but after git stash
I get:
No hay cambios locales que guardar
(roughly translates to "No local changes to save")
To make things clear: I am not interested in keeping any changes on the params.dat
file on the repo I keep at my work. I just want it to be an exact copy of whatever I pushed last to Github from home.
What is the appropriate way to handle this?