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
?
Asked
Active
Viewed 164 times
1

Reactormonk
- 21,472
- 14
- 74
- 123
-
If you plan on using Git for backups, consider using [bup](https://github.com/apenwarr/bup). – Greg Hewgill Jan 17 '12 at 20:22
1 Answers
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).
-
@GregHewgill: Argh, I can't believe I managed to mess up your name, sorry. – VonC Jan 18 '12 at 04:49