Skip to content

Instantly share code, notes, and snippets.

@BuonOmo
Last active September 3, 2021 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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#'git@github.com:'}"
all="${all%'.git'}"
IFS='/' read -r user repo <<< "$all"
cd ~/Dev
take "$user"
git clone "git@github.com:$user/$repo.git"
cd "$repo"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment