gitswitch-0.1.0 is not a library.
gitswitch
Switch between GitHub accounts (work, personal, …) on the fly. One command flips
your global git commit identity and the active GitHub gh CLI account, so
you can clone and push as the right account without hand-editing config.
Install
Requires git and the GitHub CLI (gh)
on your PATH. You authenticate to GitHub over HTTPS via gh; gitswitch
delegates all auth to it.
Usage
Running gitswitch <alias>:
- Sets your global
user.name/user.email. - Runs
gh auth switch --user <gh_user>sogit clone/pushover HTTPS use that account's token automatically.
If the target gh account isn't logged in yet, gitswitch offers to walk you
through gh auth login and then retries the switch.
Config
Profiles live in ~/.config/gitswitch/config.toml:
[]
= "Jane Doe"
= "jane@company.com"
= "jane-work"
[]
= "uzii"
= "uzii@example.com"
= "uzii"
You can edit it by hand or manage it with gitswitch add / remove.
License
MIT