AutoGit-O-Matic: Your Git Sync Sidekick

4 months ago 18

AutoGit-o-Matic Logo

Automate Git operations across multiple repositories

FeaturesInstallationUsageCron SetupConfigurationLicense

AutoGit-o-Matic is a Bash script that automates Git operations across multiple repositories. It helps you:

  • Pull or fetch updates from multiple repositories with a single command
  • Scan directories for Git repositories automatically
  • Log operations in both TXT and JSON formats
  • Dry-run capability to simulate operations without making actual changes
  • Configurable paths via an INI file
  1. Clone the repository:
git clone https://github.com/yourusername/AutoGit-o-Matic.git
  1. Make the script executable:
chmod +x autogit-o-matic.sh
  1. Create your configuration file (you can copy and modify the example one):
cp autogit-o-matic.ini.example autogit-o-matic.ini

Run the script with:

./autogit-o-matic.sh [OPTIONS]
  • --config FILE - Path to the configuration file (default: autogit-o-matic.ini)
  • --dry-run - Simulate operations without actually executing Git commands
  • --verbose, -v - Display more detailed information about operations
  • --log-file FILE - Write logs to the specified file
  • --help - Display help message and exit
./autogit-o-matic.sh --verbose --log-file autogit.log

You can also specify the full path to the script and configuration file:

/path/to/autogit-o-matic.sh --config /path/to/autogit-o-matic.ini --log-file /path/to/log/autogit.log

For example:

/home/mok/git/AutoGit-o-Matic/autogit-o-matic.sh --config /home/mok/git/AutoGit-o-Matic/autogit-o-matic.ini --log-file ~/RAMDISC/autogit.log

Note: If you don't specify a configuration file with --config, the script will automatically look for autogit-o-matic.ini in the current directory. If it doesn't find it there, it will look for the config file in the same directory as the script itself.

To automate Git operations on a schedule, you can set up a cron job:

  1. Open your crontab file:
  1. Add a line to run the script at your desired schedule. For example, to run it every hour:
0 * * * * /path/to/autogit-o-matic.sh --log-file /path/to/autogit.log
  1. For daily runs at 8:30 AM:
30 8 * * * /path/to/autogit-o-matic.sh --log-file /path/to/autogit.log
  1. To run it every 15 minutes:
*/15 * * * * /path/to/autogit-o-matic.sh --log-file /path/to/autogit.log

Make sure to use absolute paths in your cron job to avoid any path-related issues.

The configuration file (autogit-o-matic.ini) uses an INI format:

[SETTINGS] log_format = JSON # Can be TXT or JSON [PULL] # Repositories to pull from /home/user/git/repo1/ /home/user/git/repo2/ [FETCH] # Repositories to fetch from /home/user/git/repo3/ /home/user/git/repo4/

You can specify either individual repositories or parent directories containing Git repositories.

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

AutoGit-o-Matic - Automate Git operations across multiple repositories Copyright (C) 2025 Mateusz Okulanis This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Mateusz Okulanis
Email: [email protected]


Read Entire Article