Skip to content

Instantly share code, notes, and snippets.

@akameco
Last active October 4, 2017 21:01
Show Gist options
  • Save akameco/a1daead32e0d7b10219afedce8fef5a5 to your computer and use it in GitHub Desktop.
Save akameco/a1daead32e0d7b10219afedce8fef5a5 to your computer and use it in GitHub Desktop.
gcd(GitHub cd)
GHQ=`ghq root`/github.com
ME=`git config --get user.name`
gcd() {
ghq get -p $1
if [ `dirname "$1"` = "." ]; then
cd $GHQ/$ME/$1
else
cd $GHQ/$1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment