Created
July 7, 2020 16:24
-
-
Save jkrems/69bec370f92c82935bf88fa869d6b338 to your computer and use it in GitHub Desktop.
Switch to Github repo checkout, clone if it doesn't exist yet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: gh <org-or-user>/<repo> | |
# Example: gh nodejs/node | |
gh () { | |
local repo=$1 | |
local target="$HOME/code/src/github.com/$1" | |
local url="[email protected]:$repo.git" | |
if [[ ! -d "$target" ]] | |
then | |
git clone "$url" "$target" | |
fi | |
cd "$target" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See: https://twitter.com/chrisbiscardi/status/1275486079215259649