[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Keeping your history for org files
From: |
Peter BARABAS |
Subject: |
[Orgmode] Re: Keeping your history for org files |
Date: |
Sat, 15 Nov 2008 16:51:45 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Rainer Stengele <rainer.stengele <at> diplan.de> writes:
Hello,
> >
> > ------------------------------------------------------------------------
> > * Creating commits automatically
> > ------------------------------------------------------------------------
> >
> > Then I added a cron job on my workstation which commits changes to the
> > repository automagically. I decided commits once per hour is enough for
> > me so I added the following crontab entry:
> >
> > $ crontab -e
> >
> > ,----[ My crontab entry ]
> > | 0 * * * * cd ~/git/org && git add . && git commit -m "$(date)" >/dev/null
> > `----
> >
> > and I'm done. This picks up all my .org and .org_archive files and
> > tracks changes hourly.
> >
> > If I change a file a new commit gets created on the next hour. If
> > nothing changes no commit is created since there is nothing to add.
> >
I'm using a similar setup, but with a hook:
(defun git-commit ()
(when (eq major-mode 'org-mode)
(shell-command "git commit -a -m 'Auto commit.'")))
(add-hook 'after-save-hook 'git-commit)
This way, after I save the file it gets commited.
Regards,
Peter BARABAS.
- [Orgmode] Re: Keeping your history for org files,
Peter BARABAS <=