2

I'd like to implement a mechanism to synchronize files across multiple machines. I don't particularly care about files that are older than 1 month, so there is no need to keep that data around.

Git seems to do almost all of this except for eliminating old revisions. Is there a destructive command that lets me say "Kill all revisions older than X" ? Or if there is another VCS tool I can use to accomplish the same thing, I'd be very interested.

3 Answers3

3

You dont need to implement that youself. It already has been done: http://sparkleshare.org/

seler
  • 8,803
  • 4
  • 41
  • 54
  • 1
    ...although note that Sparkleshare does not clean up old history, either. This is explicitly addressed in their FAQ. – larsks Jun 07 '12 at 00:37
  • @larsks, SparkeShare does not but I do! :) Manually. Of course somebody may want to create script that will do that once in a while. – seler Jun 07 '12 at 01:45
3

Also see "git-annex assistant" and "sharebox".

Omer Mor
  • 5,216
  • 2
  • 34
  • 39
kostix
  • 51,517
  • 14
  • 93
  • 176
1

Whenever synchronization is involved, git bundle is interesting because:

  • it creates only one file (easy to copy around), which is like a git repo (you can clone/pull from a bundle)
  • it can create an incremental bundle (the first one is a full bundle, than you can use incremental ones, in order to select only the last commits, instead of the full history)

However, the repo at the other side would still get all the commits, through the pulls from the successive bundles.

Regarding incremental bundles, git bundle man page:

<git-rev-list-args>

A list of arguments, acceptable to git rev-parse and git rev-list (and containing a named ref, see SPECIFYING REFERENCES below), that specifies the specific objects and references to transport.
For example, master~10..master causes the current master reference to be packaged along with all objects added since its 10th ancestor commit.

While a rev-list like --since=30.days.ago master would be possible, it is best to make sure the incremental bundle is build taking into account the last commit used by the last bundle (especially if that last commit is older than 30 days. If it is newer, then it doesn't matter if you take "too many" commits).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250