git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Enrico Weigelt <weigelt@metux.de>
To: git@vger.kernel.org
Cc: suntong@cpan.org
Subject: Re: Mirror plain directory under git
Date: Tue, 21 Sep 2010 09:56:21 +0200	[thread overview]
Message-ID: <20100921075621.GA27575@nibiru.local> (raw)
In-Reply-To: <AANLkTi=9nqfzR-Zo85LieBuhv97oudCVZCex8ZL3mM0t@mail.gmail.com>

* Tong Sun <suntong@cpan.org> wrote:

Hi,

> How feasible it is to mirror a plain directory and put it under git
> revision control (leaving the original intact)?

Probably you'll want to have the .git dir outside of /etc, so
--git-dir and --work-dir are your friend (man 1 git).

An cron-script could look something like that:

    #!/bin/bash

    cd /var/my-etc-archive.git && \
	git --work-dir=/etc add -A && \
	git --work-dir=/etc commit -m "autocommit" && \
	git push origin

(perhaps filter the output a bit, so you don't get unncessary
cron mails ;-))


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------

  reply	other threads:[~2010-09-24 12:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20 19:12 Mirror plain directory under git Tong Sun
2010-09-21  7:56 ` Enrico Weigelt [this message]
2010-09-24 14:36   ` Daniel Johnson
2010-09-24 15:24     ` Tong Sun
2010-09-24 20:20       ` Enrico Weigelt

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=20100921075621.GA27575@nibiru.local \
    --to=weigelt@metux.de \
    --cc=git@vger.kernel.org \
    --cc=suntong@cpan.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).