Making git auto-commit

前端 未结 18 1823
面向向阳花
面向向阳花 2020-11-27 08:41

I\'d like to use git to record all the changes to a file.

Is there a way I can turn git \'commit\' on to automatically happen every time a file is updated - so ther

18条回答
  •  广开言路
    2020-11-27 09:44

    Inotify really sounds like the right tool for the job.

    There is a tool called incron which could be exactly what you are looking for. You can specify files or folders (and event types, like "change", "create", "unlink") in something like a crontab, and a command to run when such an event occurs.

    In contrast to inotifywait (which would be the analog of the poor man's cron sleep 10;do stuff), this will catch every event, not just the first.

    I haven't used it myself, but from the documentation it doesn't look too complex to setup.

提交回复
热议问题