tags:

views:

24

answers:

1

Is there away to make git only retain the most recent version of certain blob files without keeping any history on the blob?

I have a huge data set that my project relies on, but no one cases about the history of it only that it is part of the project and that they are useing the most recent data set.

Thanks.

+1  A: 

With git clone, you can create a shallow clone using the --depth option. Using --depth 1 only downloads stuff that is needed to checkout the latest tree.

From man git-clone:

--depth
Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches.

Andreas
1) I would like to be able to push to it. 2) I'm not as concerned with when I first clone the repository, but later I want to be able to pull to the repository and have the large file replaced if there is a newer data set available.
Ben
1) Afaik, you can commit to a shallow clone and push changes to a remote. The push and pull operations only transfer data which the receiver does not yet have.2) Pull first needs to download all new data and does a merge on your local branch and updates it. After that, you would need to prune older objects. I'm not sure, but I think there is no git command that can do this. But you could still re-clone your local repo with --depth 1 to get a new one that only holds the current data.
Andreas
Thanks for the clarification!
Ben