A collection of small tools for git workflows.
Clone the repository and install the package with pip
.
pip install --user .
Invoke switchbox
directly or run it via git switchbox
.
Switchbox commands assume your git repository has a default branch and a
default remote. When Switchbox is used for the first time (or you run
switchbox setup
) it will find and remember names for these.
- The default branch will use a branch named
main
ormaster
. - The default remote will use a remote named
upstream
ororigin
.
Switchbox options are set in a repository's .git/config
file under a
switchbox
section.
Show config options that Switchbox has set.
Detect a default branch and default remote, and save them to the repository's git configuration. This will be done automatically when you first use a command that works on a default branch or default remote.
Change the default branch.
Change the default remote.
- Update all git remotes.
- Update the local default branch to match the remote default branch.
- Switch to the default branch.
- Remove branches merged into the default branch.
- Remove branches squashed into the default branch.
- Update all git remotes.
- Remove branches merged into the default branch.
- Remove branches squashed into the default branch.
- Update all git remotes.