Skip to content

TUVIMEN/gitman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitman

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.

Adding scripts managing remotes

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-gitolite

gitman-github requires github-cli

Environment variables

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"

Adding repositories

After creating a local repository you can add it to registry

gitman add

You 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 tag4

Having repository in registry you can add managed remotes

gitman radd home github

When having managed remotes you can again add it to registry to update remotes

gitman add

This will create and push repositories to gitolite and github while changing tags and description

pushing changes/renaming/deleting

You can push changes to all repositories by running

for i in $(git remote); do git push "$i"; done

or simply

gitman push

You can rename repository by running

gitman move new-name

It can also be deleted

gitman delete
gitman delete -f # remove without prompt

Searching the registry

gitman 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-description

Get 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-path

Dump the registry

gitman get

Help

You can read about all available subcommands and options by running

gitman help

Subcommands also have their own help messages

gitman add --help
gitman delete --help
gitman remote --help

About

Personal collection of scripts for managing multiple git remotes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages