1

i have a few projects using git and i'd like to have a remote backup available in case our network goes down. I know how to create a bare git repository and push to it but how do i encrypt the contents so no one but us can see the source? I am thinking mounting the remote server is easiest? maybe not.

1 Answers1

0

Something like this is probably best done by backing up the git repository, running the archive through PGP or some other encryption, then sending the resulting file somewhere else, rather than trying to figure out a way to make git encrypt all its files on disk in a way that nobody but you can read.

You can take a look at this Stack Overflow question but I'm not sure that the instructions as given would apply to only the "backup" repository (it looks like anything you push or pull anywhere gets smudged/cleaned). Documentation for smudge and clean is here... judging by the documentation, using smudge and clean for encryption will not get you "best results". There were good comments on the SO question with links to more discussions: Take a look at Linus Torvalds's thoughts on the issue (read the whole thread, they've thought of things that smudge and clean won't handle like encrypting the filenames themselves, and commit log messages). You can also look at this thread which does bring up the "mount a file on a remote server as an encrypted filesystem using FUSE" idea.

DerfK
  • 19,493
  • 2
  • 38
  • 54