Home > Blockchain >  Is it possible to use git for tracking changes without storing them?
Is it possible to use git for tracking changes without storing them?

Time:11-12

I have a big directory structure with lot's of binary files (images) in it. I want to track which files were added/deleted/changed without actually storing the changes. Is it possible to do using git?

Just to retiterate, I don't care about the contents of the change, just want to register the fact the the file was added/deleted/changed.

CodePudding user response:

No. That is not, in fact, what Git is. It doesn't even know that any files were added/deleted/changed. It just takes snapshots of your actual project. Every snapshot contains all the files in the project. That is all that Git actually stores. You can't ask it not to do that; that's what Git does, period.

CodePudding user response:

You could.... with some magic tricks outside of git, actually. Generate a list of all present files (with their checksums, be it sha1 or sha256 or md5) and put them in a file... add the file, commit.... then, after a while you do the same.... add, commit..... then after a while you do the same. So..... you could, by comparing the contents of that single file over different commits, know what happened, without actually storing the images themselves. Not too elegant, but it would work.

  • Related