git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Mirror plain directory under git

From
EWEnrico 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
----------------------------------------------------------------------
Previous: Tong SunNext: Daniel Johnson
Message 2 of 5 in “Mirror plain directory under git”
  1. Tong SunSep 20, 2010
  2. Enrico WeigeltSep 21, 2010
  3. Daniel JohnsonSep 24, 2010
  4. Tong SunSep 24, 2010
  5. Enrico WeigeltSep 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.