Skip to content

Instantly share code, notes, and snippets.

@BuonOmo
Last active September 3, 2021 07:47
Show Gist options
  • Save BuonOmo/91fd48c4ed339f4ea2e107d51593e1ac to your computer and use it in GitHub Desktop.
Save BuonOmo/91fd48c4ed339f4ea2e107d51593e1ac to your computer and use it in GitHub Desktop.
Clone from github into your dev folder respecting user/repo architecture
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