Re: backup git repo on every commit
- From
Israel Garcia <igalvarez@gmail.com>
- Date
- Oct 12, 2009, 14:25 UTC
- Message-ID
- <194a2c240910120725u72cdb588p3c66bc730e6953d@mail.gmail.com>
- In-Reply-To
- <20091012141544.GF9261@spearce.org>
Hi Shawn,
That's OK, but I want to backup my git repo locally because I don't have another remote git server. Can you modify your post-commit code to backup the repo to /backups/git folder instead of using another external git repo?
thanks in advance. regards Israel.
On 10/12/09, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 17 quoted lines
> 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. >
-- Regards; Israel Garcia