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.
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode