Skip to content

Detect changes in a git working tree and commit them automatically

Notifications You must be signed in to change notification settings

shunlog/autogit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

A simple shell script that automatically detects changes in a git working tree and commits them.

The heavy work is done by entr. Basically, it takes as input a list of files and runs a command whenever any of those files change (not in a naive way). When new files are created, it exits so that we can pass it the new list of files, therefore the while loop.

fd is used to pass the list of files to be watched to entr, since it handles ignore files like .gitignore by default.

The script has to be run as a daemon in the directory it's supposed to watch. There's an example systemd service file that accomplishes this.

About

Detect changes in a git working tree and commit them automatically

Topics

Resources

Stars

Watchers

Forks

Languages