A simple bash utility that automatically commits changes in multiple git repositories.
Git Script Keeper is a bash script that helps you manage multiple git repositories by automatically detecting changes and committing them. It reads a list of repository paths from a file and processes each repository, committing any changes with an auto-generated commit message.
Inspired by etckeeper, Git Script Keeper was created to track changes in scripts and configuration folders that aren't covered by system configuration management tools.
- Automatically detects changes in multiple git repositories
- Skips repositories with no changes
- Generates commit messages that include the list of modified files
- Handles errors gracefully (non-existent directories, non-git repositories)
- Supports comments and empty lines in the repository list file
- Made to be run periodically via systemd or cron.
./git_scripts_keeper.sh <path_to_repo_list_file>
# My repositories
/home/user/projects/project1
/home/user/projects/project2
# This one is commented out
# /home/user/projects/inactive-project
/home/user/projects/project3
-h, --help
: Display help message and exit
- Bash shell
- Git
- Download this script via
git clone
- Make it executable:
chmod +x git_scripts_keeper.sh
- Create a repository list file with one repository path per line into
repos.txt
. - Launch via
./git_scripts_keeper.sh repos.txt
- Optional: make it periodic via the systemd unit in the folder
systemd_units
or via cron.