Skip to content

Instantly share code, notes, and snippets.

@natchiketa
Last active December 19, 2015 22:18
Show Gist options
  • Save natchiketa/6026183 to your computer and use it in GitHub Desktop.
Save natchiketa/6026183 to your computer and use it in GitHub Desktop.
Bash function to do a `git clone` and `cd` into the directory. Requires Node, but could be refactored to use easily use pure Bash instead. I put it in my `.bashrc`
function gcd() {
REPONAME=$(node -e "console.log(process.argv[1].match(/.*?\/([a-zA-Z0-9\-]+).git/)[1]);" $1)
git clone $1 && cd "${REPONAME}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment