Skip to content

GACS - Git Auto Commit Script, A Python script that automatically commits changes to your Git repository in real time with customizable debounce timing. Also supports Branch selection and (optional) remote.

License

Notifications You must be signed in to change notification settings

FurqanHun/git-auto-commit-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

GACS - Git Auto Commit Script

GACS - Git Auto Commit Script is a Python script that automatically commits changes to your Git repository. It watches for file changes in real-time and handles git operations automatically with customizable debounce timing. It also supports remote pushing and branch selection.

Features

  • Real-time file watching
  • Customizable debounce timing (you can tweak it!)
  • Support for specific file patterns
  • Branch selection
  • Optional remote pushing
  • File ignoring (kind of, as it's hardcoded for now)
  • Detailed commit messages (also kind of, as some file systems or apps makes changes in temp file and then rename it to original file, so it will commit it as "renamed file" instead of "changed file")
  • Time-stamped commits (UTC)
  • Session logs (Basic right now, logs the actions taken—off by default. Logs live in the script's folder)

Prerequisites

  • Python 3.x
  • Git installed and configured (It assumes you already have a git repository initialized)
  • Internet connection (for remote pushing)

The script will automatically check for and offer to install required Python packages:

  • watchdog for file watching (i created this script using v6.0.0 (current stable as of writing this) and the script just installs the latest version)

Installation and Usage

  1. Clone the repository:
git clone https://github.com/FurqanHun/git-auto-commit-py.git
  1. Change directory:
cd GACS-py
  1. Run the script:
python main.py

Why create this script?

  1. I could use inotify-tools, but there's no windows equivalent and you've to rely on github actions or other CI/CD tools.
  2. I could also create a simple bash script and create a task scheduler in Windows, but it doesn't account for real-time file watching.
  3. I could also create a powershell script, but no one sane installs powershell on Linux.
  4. I wanted a script that can run on both Linux and Windows and can be used for personal projects.
  5. Python is preinstalled on most Linux distros and you probably have it installed on Windows too.

If i find something for windows then i may update or create a shell script that handles both Linux and Windows.

Before someone mentions the inotify-tools port inotify-win, i already know about it and yet have too look into it.

Feel free to contribute or suggest changes.

License

Licensed under the GPLv3 License. See LICENSE for more information.

Tested on Fedora 41 and Windows 10

About

GACS - Git Auto Commit Script, A Python script that automatically commits changes to your Git repository in real time with customizable debounce timing. Also supports Branch selection and (optional) remote.

Topics

Resources

License

Stars

Watchers

Forks

Languages