Last active
January 4, 2016 12:09
-
-
Save jbarnette/8620038 to your computer and use it in GitHub Desktop.
cd to any repo, cloning if necessary
This file contains hidden or 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
function gd { | |
local parent=$(dirname "$1") | |
local name=$(basename "$1") | |
local owner=$(basename "$parent") | |
local nwo="$owner/$name" | |
local dir="$HOME/src/$nwo" | |
[ -d "$dir" ] || git clone "https://github.com/$nwo" "$dir" | |
cd "$dir" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment