Skip to content

Instantly share code, notes, and snippets.

@jmervine
Forked from wookimiii/grco.bash
Created December 30, 2013 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmervine/8189308 to your computer and use it in GitHub Desktop.
Save jmervine/8189308 to your computer and use it in GitHub Desktop.

Make this file executable and add it to your path

Usage

grco [some-text]
#!/bin/bash
git checkout $(git branch -ra | grep $1 | head -n 1 | awk -F'/' '{ print $(NF-1)"/"$(NF-0) }')
@jmervine
Copy link
Author

@wookimiii ^___^

@wookimiii
Copy link

@jmervine might want to change how the awk works. I tried to checkout 'dev' for 'develop' and it added a /

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