tags:

views:

281

answers:

5

Hi.

I want to use Git to backup my home drive, but I also want to use it as a version control system for projects that will be stored in my home drive.

How would I go about doing that? Do I .gitignore all the projects root folders and make new repositories for them?

Edit:

Ok I explained what I wanted wrongly. I want to have a history of changes made to my home drive like I can get with Git and I also want to back that up.

A: 

That reads pretty much like what I'm doing. I have a git repository in my home directory, but I use that to track only those configuration files that I can edit by hand. (This rules out state files kept by "modern" desktop environments and almost everything that is stored as XML.) Everything else goes into .gitignore. Once upon a time, I decided that my "notes" directory and my ~/.emacs.d should go into their own repositories, so I created git repositories in those directories and had the main repository ignore them.

I don't use this setup for backup purposes but to synchronize the tracked files between accounts on different machines, but I suppose that this could also work for backups.

hillu
Well, it's possible, but for synchronisation/backup purposes rsync will work a lot better.
Arda Xi
No.rsync has no sensible solution for me if I edit the same file on two different accounts. (unison which uses rsync's algorithm does, but it fails in other problems.) At least, git can detect and merge conflicting edits. rsync also has no answer to the question "what did file X look like 14 days ago?"
hillu
+6  A: 

Use rsync for backup. Use git for version control.

rmk
A: 

You really want to use rsync to backup your data. Check out the following url for more information on rsync and also some examples on how to backup your data:

http://www.sanitarium.net/golug/rsync_backups_2010.html

black666
+1  A: 

I wrote a blog post about this a while back. In short, don't.

BUT, if you really want to, check out bup - as far as I can tell, it does backup with git "right".

David Wolever
A: 

On windows git-extensions as well as the gitGui allow you to clone a repository, which would allow you to make a backup without all the files in .gitignore.

Next 7zip it up and you are done!

ufotds