Skip to content

Instantly share code, notes, and snippets.

@zengjiapei3000
Last active February 5, 2021 15:14
Show Gist options
  • Save zengjiapei3000/f8eab4db4bd2088bde0d346379124eaa to your computer and use it in GitHub Desktop.
Save zengjiapei3000/f8eab4db4bd2088bde0d346379124eaa to your computer and use it in GitHub Desktop.
$ curl \
-X POST \ // -X means
-H "Accept: application/vnd.github.v3+json" \ // -H means -H "Authorization: token (base64 code)"
https://api.github.com/user/repos \
-d '{"name":"name"}' // -d means data
// another options: -i means add the flag to include headers.
// -u means Use a flag to set your username(only Using personal access tokens)
$ curl -i -H "Authorization: token 5199831f4dd3b79e7c5b7e0ebe75d67aa66e79d4" \
-d '{ \
"name": "blog", \ // The resulting repository will be found at: https://github.com/<your_username>/blog
"auto_init": true, \
"private": true, \
"gitignore_template": "nanoc" \
}' \
https://api.github.com/user/repos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment