Re: backup git repo on every commit
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Oct 12, 2009, 14:15 UTC
- Message-ID
- <20091012141544.GF9261@spearce.org>
- In-Reply-To
- <194a2c240910120641sccf0e55xef4226269df78864@mail.gmail.com>
Israel Garcia <igalvarez@gmail.com> wrote:
> Which is the simplest way to backup a git repository after every commit?
Add a commit hook to push to another location, e.g.:
git remote add --mirror backup you@another.host:path/to/backup.git
cat >.git/hooks/post-commit #!/bin/sh git push backup ^D
chmod a+x .git/hooks/post-commit
-- Shawn.