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
The previous answers recommending inotifywait for this job tipped me off in the right direction when I had this problem myself, so I wrote a little script. First this could only watch whole folders recursively (the opposite of Lester Buck's example), but then I also wanted to watch a file somewhere else, so I expanded it.
The result is a script currently called gitwatch, as that is what it does: it watches a file or folder for changes (using inotifywait), and commits them to a git repository.
You can find the script, more info and instructions over on github: https://github.com/nevik/gitwatch