Skip to content

Instantly share code, notes, and snippets.

@arifsuhan
Last active September 18, 2021 19:14
Show Gist options
  • Save arifsuhan/dc965340e5599cb181d6fa345106693e to your computer and use it in GitHub Desktop.
Save arifsuhan/dc965340e5599cb181d6fa345106693e to your computer and use it in GitHub Desktop.
Clone Github Repository with Generate Github Auth Token
#!/bin/bash
function run_cmd(){
cmd="git clone https://"$1"@github.com/"$2"/"$3".git"
echo $cmd
eval $cmd
}
token="***"
owner=("user-A" "user-B")
repo_name=("repo-A" "repo-B")
index=1
run_cmd $token ${owner[$index]} ${repo_name[$index]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment