Answers for "how to download github repos with curl"

1

dowload latest release github curl

curl --silent "https://api.github.com/repos/USER/REPO/releases/latest" | # Get latest release from GitHub api
    grep '"tag_name":' |                                                 # Get tag line
    sed -E 's/.*"([^"]+)".*/\1/' |
    xargs -I {} curl -sOL "https://github.com/USER/REPO/archive/"{}'.tar.gz'
Posted by: Guest on March-04-2021
1

create github repo with curl

winpty curl -H 'Authorization: token [GENERATED_TOKEN]' https://api.github.com/user/repos -d '{"name":"[REPO_NAME_YOU_WANT]"}'

# follow steps here to generate token:
https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

# note : you can add parameters to you command to set a description, switch to private, etc...
Posted by: Guest on May-30-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language