Relying on basic authentication
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
curl -u "${USER}" -O https://${GHE_DOMAIN}/raw/${REPO_OWNER}/${REPO_NAME}/${REF}/${FILE}
|
参考:
Accessing GitHub using two-factor authentication
1
| curl -u "${USER}" -H "X-GitHub-OTP: ${OTPCODE}" -O https://${GHE_DOMAIN}/raw/${REPO_OWNER}/${REPO_NAME}/${REF}/${FILE}
|
Relying on OAuth2 token authentication
You’ll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
作为url
中的参数明文传输
1
| curl -O https://${OAUTH-TOKEN}@${GHE_DOMAIN}/raw/${REPO_OWNER}/${REPO_NAME}/${REF}/${FILE}
|
1
| curl -H "Authorization: token ${OAUTH-TOKEN}" -O https://${GHE_DOMAIN}/raw/${REPO_OWNER}/${REPO_NAME}/${REF}/${FILE}
|
Relying on SSH certificate authentication
1
| scp [-i identity_file] ${USER}@${GHE_DOMAIN}:${REPO_OWNER}/${REPO_NAME}.git/${REF}/${FILE} /path/to/local/file
|
identity_file
: 验证私钥文件