You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
oh-my-zsh plugin for easy switching between git repositories. Just typesgr <some part of you repo's name>, press enter and you're there. For additional features, see below.
To update the plugin, you can use thesgu (switch_git_update) command. This pulls the most recent version from git.
Usage
switch-git provides you with thesgr (switch_git_repository) andsgb (switch_git_branch) commands. Feel free to shorten the commands further by setting other aliases in your.zshrc.
Switch git repository
Simply callingsgr calls on a fuzzy-finding window provided byfzf to select one of your repositories. Instead of using the fuzzy finder, you can also directly add a search string. E.g. callingsgr switch may lead you to the switch-git repository on your local hard drive.
Temporary switching and git commands
switch-git also provides you with the ability to execute git commands in the found repository. If a command is provided the switch only happens temporarily in the background to execute the call. Your working directory will then be restored.
The following command, for example, goes to the switch-git repository, executesgit pull --rebase and then restores the working directory.
sgr switch pull --rebase
Switch git branch
Thesgb command calls on anfzf-provided interface to select and check out a git branch. Instead of using the fuzzy finder, you can also directly add add a search string. E.g. callingsgb feature will lead to a switch to the latest-used feature branch.
About
ZSH plugin for easy switching between git repositories and branches.