From: Israel Garcia <igalvarez@gmail.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: backup git repo on every commit
Date: Mon, 12 Oct 2009 09:39:24 -0500 [thread overview]
Message-ID: <194a2c240910120739j58cc1ec0o629b0df7d31e3fdd@mail.gmail.com> (raw)
In-Reply-To: <20091012143043.GJ9261@spearce.org>
On 10/12/09, Shawn O. Pearce <spearce@spearce.org> wrote:
> Israel Garcia <igalvarez@gmail.com> wrote:
>> That's OK, but I want to backup my git repo locally
>
> Just change the path of the backup remote (that final argument to
> git remote add) to point to the local directory.
>
> Though I guess you would also need to run git init there, e.g.:
>
> git --git-dir=/backup/project.git init
> git remote add --mirror backup /backup/project.git
>
> # and create the hook as below
Nice..:-)
>
> Of course, backup to another folder on the same disk isn't a backup
> at all, the disk can still fail and lose both repositories.
Yeap, but I use rsync to backup /backup folder on a remote server
every night. /backup folder other apps backups.
thanks Shawn.
regards
Israel.
>
>> On 10/12/09, Shawn O. Pearce <spearce@spearce.org> wrote:
>> > 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
next prev parent reply other threads:[~2009-10-12 14:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 13:41 backup git repo on every commit Israel Garcia
2009-10-12 14:08 ` Christian Himpel
2009-10-12 14:15 ` Shawn O. Pearce
2009-10-12 14:25 ` Israel Garcia
2009-10-12 14:30 ` Shawn O. Pearce
2009-10-12 14:39 ` Israel Garcia [this message]
2009-10-13 16:43 ` Israel Garcia
2009-10-13 17:49 ` Shawn O. Pearce
2009-10-13 18:08 ` Israel Garcia
2009-10-13 18:18 ` Shawn O. Pearce
2009-10-13 18:14 ` Israel Garcia
2009-10-13 18:18 ` Shawn O. Pearce
2009-10-12 18:35 ` Christian Himpel
2009-10-12 18:37 ` Shawn O. Pearce
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=194a2c240910120739j58cc1ec0o629b0df7d31e3fdd@mail.gmail.com \
--to=igalvarez@gmail.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).