My personal script for managing multiple git remotes like gitolite or github.
gitman script creates a registry of repositories in ~/.cache/gitman, where it stores first and last commit hash, tags, description, path, and list of remotes.
While working on this script i came up with name gitman, searching through github to my dismay I've discovered that there already are popular projects with that name, since they are of no use to me i didn't change the name.
gitman-github and gitman-gitolite are external script that can be added to registry as aliases.
gitman remote github ~/.local/bin/gitman-github
gitman remote home ~/.local/bin/gitman-gitolitegitman-github requires github-cli
gitman needs
export GITMAN_OWNER='hexderm'gitman-gitolite needs
export GITMAN_GITOLITE_REPO="/home/hexderm/git/gitolite-admin"gitman-github needs
export GITMAN_GITHUB_USER="TUVIMEN"After creating a local repository you can add it to registry
gitman addYou can specify or change tags and description associated with it
gitman add -d 'description' -t 'tag1|tag2' -t tag3
gitman add -d 'other description' -t tag4 -t -tag1 # removes tag1 and adds tag4Having repository in registry you can add managed remotes
gitman radd home githubWhen having managed remotes you can again add it to registry to update remotes
gitman addThis will create and push repositories to gitolite and github while changing tags and description
You can push changes to all repositories by running
for i in $(git remote); do git push "$i"; doneor simply
gitman pushYou can rename repository by running
gitman move new-nameIt can also be deleted
gitman delete
gitman delete -f # remove without promptgitman provides extensive searching capabilities. You can search by specifying extended regex for 9 options - path, description, tags, remote-name, remote-path, rmeote-date, firstcommit, lastcommit, lastchange. Output can also be changed by the same options, but beginning with --o-.
Get descriptions of all repositories
gitman get --o-descriptionGet path and remote path of repositories that are in projects directory and were modified in 2025-03
gitman get --path '/projects/' --lastchange '^2025-03-' --o-path --o-remote-pathDump the registry
gitman getYou can read about all available subcommands and options by running
gitman helpSubcommands also have their own help messages
gitman add --help
gitman delete --help
gitman remote --help