Backup your home with GIT

I travel a bit, I dont like cloud. I have 3 PCs… one at home, one at my office, one to travel..

to alive with a bit of mental sanity.. I begin to sync my home with GIT and IT’s easy!

  1. thing to know: you can’t have other git project inside it.
  2. you need a usb key to do the passage. Encripted is better!

Install git: # apt-get install git

Create a gitignore, that will ignore all your home , because there are a lot of config file that you dont want.

Go in your home and do:

$ echo "*" > .gitignore

OR

$ nano .gitignore

Type a * inside that file. ctrl+o to save; ctrl+x to exit

$ git init

And now add all the directory that you want sync in the USB key. Each:

$ git add -f directoryIlikecopy

So, do a git status, and your first commit :

$ git commit -m "Initial dirs commit"

OK. now that your local git repo is ready. mount your usb key,

go inside the USB by terminal and clone the local repo in a directory:

$clone myhome /mnt/USB/nameofyoorlocalrepo nameofdirinusb

$ cd nameofdirinusb

and you find here all your files!

after is only a thing of pull and push :)