To avoid undesired change in .rviz

You’re totally right. I got a bit mixed up on how that worked.

One option is to run git update-index --skip-worktree <path to file>. The downside to this is that it only affects the local workspace. You’d have to ask everyone on the team to run this locally when they clone the repository. (documentation)

Looks like there may not actually be a simple way to express this intent on the remote.