I'm searching on the internet how to "git pull without modifying specific files", but I'm going in circles and getting lost.
This is the scenario, I have some configuration files, let's say one of them is called C
and in this file there is my local path for some reasons while in the same file, but on the machines of my colleagues, it has their file paths. So C
contains as much different states as the total number of the colleagues in our working group.
In order to use C
locally on each of our machine we executed git update-index --assume-unchanged ..path-to-C../C
so that, whenever one of us makes a push, that specific file won't be taken in consideration. In other words, if I understood correctly, C
won't be updated in the repo on git even if we make local changes on it. In this way everyone of us can put their file path in it.
But that's only half of the problem solved.
Now what I want to do is to tell to git "I don't want you to modify in any way my local C
while I'm doing a pull".
How do I get this result?
I don't want to use the .gitignore
because by the tests we made we saw some behaviors that we don't want to happen. For example if my colleague puts C
in the .gitignore
and makes a push, when I do a pull my C
won't be present in my local repo. So everytime I make a pull I will have to put C
manually inside my project to get it working.
This is due to the fact that to make it work we do the following combination of commands:
git rm --cached ..path-to-C../C
move C to the .gitignore (with intellij .ignore plugin)
from intellij mark it as a file to be untracked
The result of this is that Intellij highlights our file with a yellow color in order to say "hey this file is officially untracked".
What I want is to automate this part of the process by marking in some way the file like I did for the push but for the pull in this case.