Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

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.

share|improve this question

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.

share|improve this answer

Your Answer


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.