Skip to content

Scripts to help you autocommit your work with git when a file changes in the directory

License

Notifications You must be signed in to change notification settings

androsland/GitAutoCommit-Win

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitAutoCommit-Win

Scripts to help you autocommit your work with git when a file changes in the directory on Windows.
Bad practice or not, this is sometimes needed.
As a commit message you get the path to the file and the how that file was changed (e.g MODIFY for file change)
For more information on these events, go to inotify-win's repo (link in the references)

Prerequisites

WARNING: Running filechangelistener.sh will delete any existing .git folders and initialize a new git repository in the directory where it exists. YOU HAVE BEEN WARNED.

How to use

  • (OPTIONAL) Edit filechangelistener.sh and autocommit.sh and set the DUMMYFILE variable.
    Please note that the scripts reference the directory where they exist, so you will have to place the scripts in the folder you want the autocommit feature to be applied.
  • Run filechangelistener.sh. This files uses inotifywait to listen to file changes
  • Run autocommit.sh. This file will commit any changes caught by filechangelistener to the local repository. No push available. Change accordingly.

Making the scripts run as services

For Windows 7,8 Systems

To make the scripts run without interference, you can create a Windows service for each one.
Start cmd as an administrator and execute the following command to create a service

sc create service_name binPath= "full_path_to_script" displayname= "display_name" start= auto

service_name: Give your service a name.
full_path_to_script: Full path to the the script you want to make a service of.
display_name: A name that will be displayed for the service.

For older versions of Windows systems

Making batch files and executables run as services is not allowed in older versions of Windows (tested on Windows Server 2003).
A possible alternative is creating tasks that run the scripts every N minutes. This makes sure that the scripts are always running. Just make sure you set the task up to destroy itself every time it is recreated!

Task scheduler versions of the scripts are located in the scheduler folder in the repository

References

About

Scripts to help you autocommit your work with git when a file changes in the directory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages