Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question should probably be posted at superuser.com, 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
1  
bad idea, imo. git is not for that. –  ldigas Dec 31 '09 at 15:00
1  
if you really need to be sure the files copied are the ones, then just take some tool and calculate the hashes with it. –  ldigas Dec 31 '09 at 15:00
add comment

migrated from stackoverflow.com Jan 1 '10 at 16:34

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

4 Answers

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
add comment

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
add comment

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.