Simple script to switch between github acounts using fzf
NB: Please note this is still a work in progress.
-
Install fzf
-
Installation
- MacOS
brew tap joobisb/gh-switch brew install gh-switch - Ubuntu
- Clone the repository
- Copy
switch.shto root directorycp switch.sh ~/.
- Set an alias in your shell configuration file (.zshrc/.bashrc)
alias gh-switch="~/switch.sh"
- MacOS
-
Set the ssh-keys for multiple accounts following this gist following until Step 5 of the gist.
-
Set the git profiles by running the following command
gh-switch add- This command will prompt to add the following for two git profiles
- git username
- git email
- ssh host name set in Step 3
- This command will prompt to add the following for two git profiles
-
Run
gh-switchcommand to switch between the git profiles
- Current version only support adding 2 git profiles.
- Currently the tool does not support its installation via any package manager for Ubuntu.