Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ZSH plugin for easy switching between git repositories and branches.

License

NotificationsYou must be signed in to change notification settings

robin-mbg/switch-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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.

oh-my-zsh installation

  1. Clone the git repository
git clone https://github.com/robin-mbg/switch-git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/switch-git
  1. Enable the plugin in your.zshrc
plugins(    ...    ...    switch-git)

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp