diff --git a/README.md b/README.md index b8bbc6677..26bd60a0d 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ If you aren't using any zsh frameworks, or if you're a bash user, do the followi | `git-shamend` | Danielle Sucher's [git-shamend](http://www.daniellesucher.com/2014/05/08/git-shamend/) blog post | Amends your staged changes as a fixup (keeping the pre-existing commit message) to the specified commit, or HEAD if no revision is specified | | `git-show-overwritten` | Mislav Marohnić's [dotfiles](https://github.com/mislav/dotfiles) | Aggregates `git blame` information about the original owners of lines changed or removed in the '...' diff.| | `git-sp` | A. Schwarz's [git-sp](https://github.com/Schwarzy1/git-sp) | "Simple push", single short command to commit, and push. Use -a flag to add all files to commit.| +| `git-switch` | Andrew Steele's [dotfiles](https://github.com/Andrew565/dotfiles) | Make it easier to switch to a branch by a substring of its name. More useful if you are good about deleting branches which have been merged upstream and if your branch names include unique identifiers like ticket/issue numbers.| | `git-submodule-rm` | Greg V's [dotfiles](https://github.com/myfreeweb/dotfiles) | Allows you to remove a submodule easily with `git submodule-rm path/to/submodule` | | `git-thanks` | Mislav Marohnić's [dotfiles](https://github.com/mislav/dotfiles) | List the contributors to a repository in descending commit order, even if their contribution has been completely replaced | | `git-track` | Zach Holman's [dotfiles](https://github.com/holman/dotfiles) | Sets up your branch to track a remote branch. Assumes you mean origin/localbranchname | diff --git a/bin/git-switch b/bin/git-switch new file mode 100755 index 000000000..0874146a9 --- /dev/null +++ b/bin/git-switch @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# +# Make it easier to switch to a branch by a substring of its +# name. More useful if you are good about deleting branches +# which have been merged upstream and if your branch names include +# unique identifiers like ticket/issue numbers. +# +# Source: https://github.com/Andrew565/dotfiles + +BRANCH=`git branch | grep "$1"` +exec git checkout $BRANCH