LoginSignup
0
0

More than 3 years have passed since last update.

githubからreleaseタグ、commitID、branch名の3パターンでcurlする

Last updated at Posted at 2019-11-08

普通の使い道ならcloneかsubmoduleでやるべきです
ど〜〜〜〜してもcurlでやりたいとき用のまとめ

organizationでprivateなリポジトリでも引っ張れます

releaseにあるブツをひっぱる

curl -OL --user ':{your personal access token}' \
https://github.com/{owner}/{repo name}/archive/{release tag}.tar.gz

masterをひっぱる

curl -H "Authorization: token {your personal access token}" \
-L https://api.github.com/repos/{owner}/{repo name}/tarball > master.tar.gz

commitID指定でひっぱる

tarballのうしろに追記するだけ

curl -H "Authorization: token {your personal access token}" \
-L https://api.github.com/repos/{owner}/{repo name}/tarball/{commit ID} > branch.tar.gz

branch指定でひっぱる

tarballのうしろに追記するだけ
commitIDと置き換わるかたち

curl -H "Authorization: token {your personal access token}" \
-L https://api.github.com/repos/{owner}/{repo name}/tarball/{branch name} > branch.tar.gz
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0