views:

34

answers:

1

Hello,

We have a file that we need to be tracked in our Git repository. Most users need to be using this file as normal: committing changes to it, pushing, pulling, etc…

We have one user for whom this file causes various computer issues, and never uses this file regardless. We want this user's repo to "skip" dealing with this file altogether.
Whatever's in there now is OK to stay, but new changes to it shouldn't be fetched.

I tried removing the cached version and setting it to ignore, but changes to locally-ignored files still get fetched and merged.

Does anybody know how to accomplish this?

Thanks so much!

-Matt

+2  A: 

You can try a git filter driver:

alt text

with a smudge/clean script:

  • able to detect the problematic content
  • replace it ('smudge') by the current content (saved as another file, ready to replace the dangerous content of the problematic file)
  • restore the originally fetched content on commit ('clean')

That filter driver would be declared in a .gitattribute file visible only in the branch in which the user has to work.

VonC
This is really helpful. I had no idea those existed. I'll play around with that-- thanks!
Matt