Skip to content

Instantly share code, notes, and snippets.

@ralt
Last active December 15, 2015 00:59
Show Gist options
  • Save ralt/5176460 to your computer and use it in GitHub Desktop.
Save ralt/5176460 to your computer and use it in GitHub Desktop.
Easier git checkout
#!/bin/bash
branch=$1
shift
git checkout $(git branch -a | grep $branch | head -n1) $@
@ralt
Copy link
Author

ralt commented Mar 16, 2013

Usage example:

$ git branch -a
1648-some-long-branch-name-thats-a-pita-to-write
$ git-co 1648
Switched to branch '1648-some-long-branch-name-thats-a-pita-to-write'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment