Frage

I have a file that I want it to be part of the repository but I don't want to commit its changes every time I run the commit -a command I normally use, but only when I manually add it to the staging area.

Is it possible with Git?

For the sake of clarity, it's a binary "output" file (a spreadsheet) that contains also some logic on how to handle the data, so I want to commit it only when I change its logic/structure and not the stored data.

War es hilfreich?

Lösung

I would suggest that you really shouldn't be using git commit -a all the time, but rather commit incremental changes with git add -p; git commit -v.

However, if you still wish to go ahead, you need to do git update-index --assume-unchanged <file>, and then when you want to commit that file, do git update-index --no-assume-unchanged <file>.

Ref: http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top