A simple Go application to automate updating multiple local git repositories by pulling the latest changes.
- Reads a list of repository paths from a configuration file.
- Iterates through each repository and performs a
git pull. - Logs the update status for each repository.
-
Clone this repository:
git clone https://github.com/gor0utine/git-updater.git cd git-updater -
Configure repositories:
- Create a file named
config.jsonin the project directory. - Add the absolute paths to your local git repositories, one per line.
Example
config.json:{ "interval_minutes": 10, "repositories": [ "/Users/Username/Projects/my-awesome-project" ], "folders": [ "/Users/Username/Projects/golang-projects" ] } - Create a file named
-
Build and run:
go build -o git-updater main.go ./git-updater config.json
- Go 1.18 or newer
- Git installed and available in your system's PATH
The application reads the config.json file, changes directory to each listed repository, and runs git pull. Output and errors are logged to the console.
MIT License