I have a GitHub fork of an open source library. In my local copy of that fork I have modified many of the CMakeLists.txt included (and other files) so that it does not compile the whole library (since there are plenty of things I do not need). Therefore, in order to smoothly integrate my changes I do
git update-index --assume-unchanged <files>
So that allows me to use git as if I did not change any of those files. However, whenever the remote has changes and I try to pull them (or whenever I want to create a new branch), I get the following error:
error: Your local changes to the following files would be overwritten by merge:
CMakeLists.txt
demos/CMakeLists.txt
<other files>
Please, commit your changes or stash them before you can merge.
Aborting
So I have to undo all the changes manually, and git update-index --no-assume-unchanged <files>
, pull and then redo again changes and update-index
. This is painful, since I have to do it almost daily.
What I want here is to update my locally-modified files if they have any change (actually, they are not likely to be changed, so the probability for conflicts is low) but to keep the changes I did and keep git assuming that they have not been changing.
Is there a better way of doing this?
EDIT: sorry if this has been asked already. I was looking for it but I was unable to find a response for my specific case. Thank you!