Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question should probably be posted at, but I guess we've got some more git experts here..

What I'd like to do is to use git as a backup tool, but WITHOUT having a local .git directory with all it's contents on the working machine.

I could do it by symlinking the .git directory to the backup disk, but maybe there's a better way? Also, I'd like to use ssh instead of mounting an USB disk, so the backup disk could be somewhere else.

The reason for this, if anybody wonders, is that I want to backup my music collection from a laptop with a limited drive. Having all the files twice within the .git directory seems a bit overkill.

share|improve this question

migrated from Jan 1 '10 at 16:34

This question came from our site for professional and enthusiast programmers.

bad idea, imo. git is not for that. – Rook Dec 31 '09 at 15:00
if you really need to be sure the files copied are the ones, then just take some tool and calculate the hashes with it. – Rook Dec 31 '09 at 15:00
up vote 2 down vote accepted

I'd also suggest that you use a proper backup tool, such as rsync/rsnapshot (if you need the backed-up files to still be playable) or duplicity (if you don't). If you need to sync in both directions, or want to see what has changed before syncing, there's also unison, which I use to keep the music files on my Laptop in sync. Additional verification of file integrity could be done using a tool like md5deep, however you'd have to write wrapper-scripts yourself.

If you really, really want to use something git-based, you could look at gibak, which is a general-purpose backup-tool based on git. I haven't looked at it too closely though, so it might not be the right choice for you; I think you would still need to symlink the .git-directory for one.

share|improve this answer
Thanks for that, i'll look into these tools. – Dave Vogt Jan 1 '10 at 14:30

you can use rsync, which is more suited for basic mirroring than using a version control system

share|improve this answer
I'm currently using a combination of hardlinks and rsync for backup, but i'd like to have some of git's features like log, and the security of the sha1 hashes. – Dave Vogt Dec 31 '09 at 14:52
rsync can log ('-v).. not really sure why you need sha1 hashes to back up music between two machines, to each his own! – bigjust Dec 31 '09 at 15:12
To verify that the files have transferred correctly, and there's no corruption. – Dentrasi Jan 1 '10 at 16:39

git is for versioning files. If you just want a backup try rsnapshot.

share|improve this answer

Using git as a backup is a bad idea. If you want to preserve space on your laptop, perhaps consider using a bare repository and writing a wrapper around your music player that will extract the files as needed from the repository.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .