Created
February 10, 2022 09:32
-
-
Save kusa-mochi/5adb64bbee3f6be8d1a67a7006c328ee to your computer and use it in GitHub Desktop.
GitHubにあるリポジトリから、特定のフォルダ以下のファイルを、ダウンロード容量を節約しつつ取得するPowerShellスクリプトのサンプル。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHubにあるリポジトリから、特定のフォルダ以下のファイルを、ダウンロード容量を節約しつつ取得するPowerShellスクリプトのサンプル。 | |
$userName = "kusa-mochi" | |
$repoName = "image-tracer" | |
$targetFolderPath = "ImageTracer/ViewModels/" | |
$repoUrl = "https://github.com/${userName}/${repoName}.git" | |
set-location ../ | |
remove-item $repoName -Recurse -Force | |
git clone --depth=1 --filter=blob:none --sparse $repoUrl | |
set-location $repoName | |
git sparse-checkout init --cone | |
git sparse-checkout set $targetFolderPath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment