20

I am working with lots of text files daily and I use Dropbox as a way to restore earlier versions of files in case something goes wrong.

I am looking for simple way to suplement/replace Dropbox in that function in case my Internet connection goes off and Dropbox is not working. Basically, I would like use git to:

1) Automatically save every revision of every file on disk or in given folder, but limited to certain extensions (.html, .tex, .txt, .doc, .odt etc.)

2) Easily browse previous versions and restore them. Ideally, I would be able to choose destination folder for keeping revisions

Creating a new Git project for each file is not very good idea, so I am looking for something simpler that will just re-create folders structure with an option to restore previous versions.

Rafal
  • 1,787
  • 4
  • 20
  • 29
  • 5
    You can use a single git repository for all your files. You just have to make sure to commit your files one at a time to have a better overview for each file. There are several git clients to help you manage your repository (viewing and restoring old revisions of files for instance) [GitCola](http://git-cola.github.io/) is the one I use when not working with netbeans git plugin. To make online backups, [BitBucket](https://bitbucket.org/) is a good and free plattform, that also allows free private repositories. – mondjunge Oct 02 '13 at 11:56
  • 1
    @mondjunge Thanks for suggestions. However, I am looking for solution that will not require commiting revisions after initial set up for given folder and all subfolders. I do not want to commit version manually each time - I know it will make revisions harder to recognize, but I want it to work on its own. – Rafal Oct 02 '13 at 11:59
  • Valid. Maybe what you need is a backup Tool. I have not enough experience with them to recommend one. I use Deja Dub, but seriously, I only see that it does something, I do not know if it works (until my machine smokes and I get a new one) – mondjunge Oct 02 '13 at 12:26
  • I would say that this is generally a bad idea, since putting a lot of binaries into `git` may result in size bloat, a lot of garbage, and performance problems. Not taking inconvenience of such backup into account. – Michael Pankov Oct 02 '13 at 16:34
  • @mondjunge if you've never tested the restore feature then you're also operating without backup IMO. – Dan Is Fiddling By Firelight Oct 02 '13 at 18:03
  • @Dan Neely: True. I am not a backup role model, but at least there is a chance that my important files are saved and can be restored, even when I haven't tested the feature yet. – mondjunge Oct 08 '13 at 11:25

3 Answers3

23

How about using SparkleShare?

SparkleShare is intended for synchronizing projects between multiple contributors automatically using Git. You can use it basically as a tool for automatically saving changes to files it a version controlled Git repository, and don't need to use its multiple contributor features.

It will connect to various services, including BitBucket:

SparkleShare Setup

Here you can see the history it presents of a folder:

Recent Changes

SparkleShare only saves changes and keeps a list of the changes. There is no way (that I know of) to use it to view a file at a particular commit. Clicking on the file in the Recent Changes dialog just opens the newest version.

So, you can use a Git client, such as Giggle Install giggle to view changes at particular commits:

Giggle

However, Giggle will not let you view the actual file at a particular commit, instead forcing you to view changes. So, you might want to use a different client such as gitg Install gitg:

gitg

(The black everywhere is a bug because I'm using the GNOME 3.8 PPA.)

You can install SparkleShare by clicking on this button:

Install via the software center

Or, you can use this command in a terminal:

sudo apt-get install sparkleshare
iBelieve
  • 5,384
  • 3
  • 30
  • 58
  • I would love to use sparkle-share. I don't know if there is a ppa which has this [patch](https://github.com/hbons/SparkleShare/issues/462#issuecomment-17282955) integrated. Can't live without correct m-time. – MadMike Oct 10 '13 at 12:55
11

If you're looking for an advanced backup tool, I'd recommend Back In Time Install backintime-gnome.

enter image description here

You can configure it in many, many ways, but here is how I use it:

  • Take a snapshot every hour
  • Keep hourly snapshots for the past 24 hours
  • Keep daily snapshots for the past 7 days
  • Keep weekly snapshots for the past 4 weeks
  • Keep monthly snapshots for the last 24 months
iBelieve
  • 5,384
  • 3
  • 30
  • 58
-1

If you use Linux, you can try Btrfs file system, it has wonderful backup functionalities.

If you move to FreeBSD or OpenIndiana you can use XFS.

Lewis Goddard
  • 3,575
  • 4
  • 33
  • 61
btreus
  • 11
  • What that have to do with Dropbox or GIT? – Braiam Dec 06 '13 at 16:38
  • @Braiam I think the implication was that the snapshot and revision capabilities Btrfs supplies would be natively capable of replacing a more software-based solution. – Lewis Goddard Dec 06 '13 at 20:40
  • @btreus Thanks for suggestion. However I am looking for as simple solution as possible, without switching to another file system (I use ext3 right now). – Rafal Dec 07 '13 at 06:15