Gum is a tool for managing many git repositories at once. It's ideal for making mass edits, retrieving information from a common place in many repos, and other large scale scripting tasks.
git clone
go install
The commands below show a basic workflow of:
- setting a prefix
- cloning and registering repos
- deleting a file from the repos
- committing and pushing changes
gum prefix [email protected]:zemberdotnet/
gum clone gum
gum register gum
gum clone blog
gum register blog
gum sh rm README.md
gum add README.md
gum commit -m "removing readme"
gum push
- used to set a prefix for use in
gum clone
- example usage:
gum prefix [email protected]:zembderdotnet/
make
is a convience command to clone all the repos in the current group. Given
the following .gum
file:
{
"Prefix": "[email protected]:zemberdotnet/",
"CurrentGroup": "default",
"Groups": {
"default": ["hnreduce", "gum"],
"otherGroup": ["blog"]
}
}
make would clone [email protected]:zemberdotnet/hnreduce
and [email protected]:zemberdotnet/gum
to the local working directory. This command can be useful when setting up a working environment.
group
changes the active repo group. The default group is default
. This allows
switching between different groups of repos contained in the same directory.
register
adds a local repo to the current group. Given the active group is default
and a directory like the following
ls -a
blog/ .gum gum/
Doing the gum register blog
would add the blog
repo to the current group, default
.
unregister
removes a local repo from the current group.
list
prints a new-line delimited list of the repos registered in the current group.
clone
works the same way as git clone <repo>
. It works in combination with
your current prefix
, if you've set one.
Example usage with gum prefix
:
gum prefix [email protected]:zemberdotnet/
gum clone gum
gum register gum
ls -a
.gum gum/
Example usage without using gum prefix
:
gum clone [email protected]:zemberdotnet/gum
gum register gum
ls -a
.gum gum/
status
works the same git status
does. It will print the git status
for each
repo registered in the current group. It accepts the same flags that git status
accepts. Example usage to print the short-form status for all registered repos:
gum status -s
#target:gum
M README.md
#target:blog
M README.md
add
works the same as git add <changed file>
. It will attempt to add the file
in every repository that is registered in the current group.
add
also accepts the same flags that git add
does. The following shows a common
example of add
:
gum sh rm README.md
gum status
#target:gum
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: README.md
no changes added to commit (use "git add" and/or "git commit -a")
#target:blog
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: README.md
no changes added to commit (use "git add" and/or "git commit -a")
gum add -A
gum commit -m "remove README.md"
gum push
- commit
- push
- sh
- checkout
- pull
- switch
- stash