Skip to content

lamusique/GitAutoCommitOnMac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Auto Commit on Mac

Protocol

Install fswatch

$ brew install fswatch

Run detection

A command line here is an example.

$ cd <the root of the local git repository>
$ fswatch -0 . -l 10 -e "\\.git.*" | xargs -0 -n 1 -I{} sh -c 'git add .; git commit --author="Author automatic <author@users.noreply.github.com>" -m "auto commit changes.";'

Edit anything

Caveat

  1. Don't use git commit -am because -a doesn't treat a new file.
  2. Better to put .gitignore first to prevent exhaustive detection.
  3. Better to create a branch for this auto committing because the commit history gets messy about.
  4. Set a latency not to commit too sensitive changes, e.g. -l 10.

About

Git Auto Commit On Mac

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published