Re: Mirror plain directory under git
- From
- Enrico Weigelt <weigelt@metux.de>
- Date
- Sep 21, 2010, 07:56 UTC
- Message-ID
- <20100921075621.GA27575@nibiru.local>
- 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 ----------------------------------------------------------------------