curlを使用して特定のgithubブランチの最新バージョンをダウンロードしようとしています。
curl -L https://github.com/nativescript/docs/tarball/production | tar zx
ただし、これにより、NativeScript-docs-ed0d16f
コミットごとに名前が変更されるため、コードでの操作が難しいなどのファイルが作成されます。そのファイルをダウンロードする方法はありますがdocs-latest
、コマンドラインからフォルダーを呼び出す方法はありますか?
ダウンロードしたファイルの名前がわからない場合は?
質問のリンクで.../archive/...
はなく、新しいリンクを使用.../tarball/...
してください。一般的な形式は次のとおりです。
https://github.com/<group_or_organization>/<repo>/archive/<refspec>.tar.gz
したがって、たとえば:
$ curl -L jttps://github.com/nativescript/docs/archive/production.tar.gz | tar tz
docs-production/
docs-production/.gitattributes
docs-production/.gitignore
docs-production/.gitmodules
docs-production/.vscode/
docs-production/.vscode/settings.json
docs-production/README.md
...
生成された最上位ディレクトリ名は<refspec>
、コミットIDに変換するのではなく、指定したものを使用していることがわかります。
同様に:
$ curl -s -L https://github.com/nativescript/docs/archive/ErikEdits-css-annimations.tar.gz | tar tz
docs-ErikEdits-css-annimations/
docs-ErikEdits-css-annimations/.gitattributes
docs-ErikEdits-css-annimations/.gitignore
...
ブランチ名の代わりに、他のgit
refspecを使用できます。例えば:
https://github.com/nativescript/docs/archive/HEAD^.tar.gz
または:
https://github.com/nativescript/docs/archive/v2.3.0-20-ged0d16f.tar.gz
ただし、これらの場合、参照はコミットIDに変換されます。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加