Skip to content
Git utility to checkout previously used branches easily
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
git-switch-completion.bash
git-switch-completion.zsh
git-switch.man
git-switch.rb

README.md

git-switch

Allows to checkout easily previously used branches. It can list branches by checked out date or by modified date, that is, branches with newest commits.

git-switch showcase

Synopsis

git switch [<options>]

or

git switch -

to checkout previous branch

Options

Short Long Description
-o --checked-out Show recently checked out branches. By default it lists by branch's modified date.
-m --modified Show last modified branches
-i --no-interactive Don't use interactive mode. Interactive by default.
-c NUMBER --count=<NUMBER> Print first NUMBER of branches. By default it prints nine.
-v --version Show version number and quit

Configurations

You can configure git switch to do "checked-out" order by default

git config --add switch.order checked-out

You can also configure the number of branches to show

git config --add switch.count 5

Installation

You can install it on OS X using Homebrew

$ brew tap san650/git-switch
$ brew install git-switch

Or you can clone the repository and link git-switch.rb to your bin directory

$ git clone https://github.com/san650/git-switch.git
$ cd git-switch
$ ln -s $(pwd)/git-switch.rb /usr/bin/git-switch

Update

With Homebrew

$ brew upgrade git-switch

Or using the git repository

$ cd git-switch
$ git fetch origin
$ git checkout v1.0.0

Uninstall

$ brew uninstall git-switch
$ brew untap san650/git-switch

Tests

Ruby 1.8.7

$ ruby -rubygems tests/acceptance.rb

Ruby 1.9+

$ ruby tests/acceptance.rb

Contributors

License

git-switch is licensed under the MIT license.

See LICENSE for the full license text.

You can’t perform that action at this time.