Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to `git add` a file currently protected by `assume-unchanged`?

Tags:

git

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?

like image 394
TheBuzzSaw Avatar asked Apr 20 '14 22:04

TheBuzzSaw


1 Answers

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
like image 123
VonC Avatar answered Oct 12 '22 10:10

VonC