git-repos-manager

command module
v1.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Git repositories manager

Readable slow install (parallel cloning off)

Fast install (default, parallel install on)

Git status for all repositories

Git pull in all repositories

How it works

  1. The list of git repositories to clone is read from the config file (repos-manager-config.json by default, can be changed) from the repositories field.
  2. All git repositories are cloned into the specified folder (src/repos by default, can be changed)
  3. Before cloning a repo, the local folder with this repo is deleted if it exists.
  4. If a repository has unsaved changes, it is skipped so you won't lose any changes

How to use

If you're on mac, you can just use already compiled build/repos-manager file from this repo. If you're not on mac:

  1. Clone this repo
  2. Install go
  3. Run go build -o build/repos-manger inside the cloned repo to generate a compiled file for your operating system (instead of repo-manager you can use any filename)
  1. Copy the repos-manager file that contains the app from build directory to the place where you want to manage multiple git repositories.
  2. Copy .env file from this repository to the same place. It contains the environment variables required for the app to run.
  3. You can change any environment variables you want in .env + the app also reads a file .env.local
  4. !Important! If you're cloning git repositories with ssh - set the path to your ssh key in the env config file.
  5. Create repos-manager-config.json with the list of your git repositories (an example of the config file is available few headers below)
  6. Run the app to clone all your git repositories: ./repos-manager
Final file structure in your project:

repos-manager
repos-manager-config.json
.env
.env.local (optional)

.env config example

CONFIG_FILE="repos-manager-config.json"
REPOS_DIR="src/repos"
SSH_KEY_PATH="/Users/your_username/.ssh/id_rsa"
SSH_KEY_PASSWORD=""

CONFIG_FILE - the name of the JSON file from which the list of git repositories to clone is read. Inside, the field repositories is used

REPOS_DIR - relative path to the directory to which git repositories will be cloned. Don't forget to add it to .gitignore

SSH_KEY_PATH - absolute(!) path to your local private ssh key
SSH_KEY_PASSWORD - your ssh key password (if there's none - leave empty)

repos-manager-config.json config example

{
   "repositories": {
      "test": "git@github.com:SergeyDarn/test-module-js.git",
      "storefront-query-builder": "https://github.com/DivanteLtd/storefront-query-builder.git",
      "scrape-search-ai": "https://github.com/SergeyDarn/scrape-search-ai#dev",
      "magnific-popup": "git@github.com:SergeyDarn/Magnific-Popup.git#1.8.0",
      "Course_Bash": "git@github.com:SergeyDarn/Course_Bash-Programming.git#3a7a19020151b45a29896c9142723efe5b11a061"
   }
}
  1. Repository test-module-js with the name test. Normal ssh link
  2. Repository storefront-query-builder. Normal https link
  3. Repository scrape-search-ai. Https link with the branch dev
  4. Repository Magnific-Popup with the name magnific-popup. Ssh link with the tag 1.8.0 (the app uses \d(\..*)+ regex for determining that it's a tag).
  5. Repository Course_Bash-Programming with the name Course_Bash. Ssh link with a specific commit hash

Available commands

    # Help. List all available commands
    ./repos-manager -h
    # Run the app
    ./repos-manager 
    # Run the app without cloning repositories in parallel. Much slower, but better log readability.
    ./repos-manager --parallel-cloning=false
    # Forcibly delete the whole directory with your git repositories before running the app.
    ./repos-manager --safe=false 
    # See the list of git repositories that have unsaved local changes. No repositories are cloned when using this flag
    ./repos-manager --status
    # Perform git pull for all repositories
    ./repos-manager --pull

Usage as a go module

This app can also be installed as a go module in your go program. It wasn't planned at first, but I decided to implement it for my Configs Manager app. It's not pretty and for sure doesn't follow the best practices for creating go modules (because I don't know them), but it works.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package manager provides the core application logic
Package manager provides the core application logic
Package utils provides a collection of useful general utilities
Package utils provides a collection of useful general utilities

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL