views:

142

answers:

2

Say I have a huge git repository and it has a number of swfs and images in there. I want them to be included in the hosted github repository, but they don't need to be versioned, and I don't want to have to store them somewhere else.

What is the simplest way I can remove their history every time I commit to a repository? ...Such that, in the end, I have all the swfs and images, but no history for them.

Edit: The swf files are likely to change often so we can count on there being different versions for each commit.

+4  A: 

Not a direct answer, but I am not sure if there is a problem here:

If your swfs and image files do not move, they will have the same SHA1 commit after commit. They will occupy the same disk space and refer to the same blob.
according to GitPro book:

A "blob" object is nothing but a chunk of binary data. It doesn't refer to anything else or have attributes of any kind, not even a file name.

Since the blob is entirely defined by its data, if two files in a directory tree (or in multiple different versions of the repository) have the same contents, they will share the same blob object.
The object is totally independent of its location in the directory tree, and renaming a file does not change the object that file is associated with.

And if your "resources" files (swf and images) evolve in time, recording their history is interesting to be able to get back in time and see a coherent configuration (i.e. source + resources valid at the time)

VonC
+1  A: 

It won't be possible to remove "history" without destroying the SHA1 integrity of the complete repository timeline. This is one of Git strongest feature: Each commit id is a hash built from its complete historical timeline.

But as far as I know binary objects are stored in some sort of diff so it won't waste too much storage - if that is your concern.

Otherwise try to work with submodules if you just want to get the big binary data out of the way and host that elsewhere.

hurikhan77