Last active
September 3, 2021 07:47
-
-
Save BuonOmo/91fd48c4ed339f4ea2e107d51593e1ac to your computer and use it in GitHub Desktop.
Clone from github into your dev folder respecting user/repo architecture
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
function clone { | |
local all user repo | |
(( $# != 1 )) && echo "usage: clone <url>" && return 1 | |
all="$1" | |
all="${all#'https://github.com/'}" | |
all="${all#'[email protected]:'}" | |
all="${all%'.git'}" | |
IFS='/' read -r user repo <<< "$all" | |
cd ~/Dev | |
take "$user" | |
git clone "[email protected]:$user/$repo.git" | |
cd "$repo" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment