I have a similar situation like this: Link Basically, I have a file called settings_data.json in my repository. I have --skip-worktree flag set on this file, so that if I make changes on my local machine, I don't accidentally push those changes to production. This is a normal approach for a situation like this, I understand. The problem is, that this file also changes on production independently. In this situation, when I make a pull, I don't want to pull changes for this file on my local repository. I want to completely ignore it. Is there an opinionated approach for a situation like this?
EDIT: I found a "partial solution" based on this answer. I wrote a bash script for git alias, that pulls from remote without comitting, then check out files that has conflict and finally commit changes. But this also pulls changes that I don't want to have locally. I still need something to completely ignore files I don't want to change locally.
This is my alias: pullbase = "!f() { git pull base main --no-commit; git diff --name-only --diff-filter=U --relative | xargs git checkout HEAD; git commit --no-edit; }; f"