5

I have certain files that I rarely want new versions committed on but change often due to IDE settings.

git update-index --assume-unchanged meta.xml

Is it possible to forcibly git add meta.xml without having to apply no-assume-unchanged first?

TheBuzzSaw
  • 8,648
  • 5
  • 39
  • 58
  • I think there's `-f` flag. It certainly works for normally ignored files – user3159253 Apr 20 '14 at 22:41
  • Yeah, it does work on ignored files, but I tried it here. It had no effect. I'm just hoping I can manually add files without having to turn this protection off each individual time. – TheBuzzSaw Apr 20 '14 at 22:41

1 Answers1

5

It doesn't seem possible: both git update-index --assmue-unchanged and git update-index --skip-worktree would make a git add impossible.

That leaves you with the definition of an alias, which would:

git update-index --no-assume-unchanged
git add -- theFile
git update-index --assume-unchanged

Something along the lines of:

addf = "!f() { git update-index --no-assume-unchanged -- $1; git add -- $1; git update-index --assume-unchanged -- $1}; f
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250