1

I'd like to use git for backups, but using more than double the space for .git is a bit too much. Is there a nice parameter that places the data somewhere else or do I have to mount my backup HD to .git?

Reactormonk
  • 21,472
  • 14
  • 74
  • 123

1 Answers1

4

You can use the GIT_DIR environment variable in order to put your .git in another place than your current working tree.

From Git man page:

--git-dir=<path>

Set the path to the repository. This can also be controlled by setting the GIT_DIR environment variable. It can be an absolute path or relative path to current working directory.

Note that you will find valid alternatives for backing up a Git repo in this SO question (not including the bup system mentioned by Greg Hewgill in the comments, python-based, which stores its data in a git-formatted repository).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250