Created
October 25, 2022 19:16
-
-
Save mikeblakeuk/4f073d92904db135edbaa6689154bec0 to your computer and use it in GitHub Desktop.
Fast sparse Checkout for Azure DevOps
This file contains 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
parameters: | |
folders: '*' | |
steps: | |
- bash: | | |
set -ex | |
export ORIGIN=$(Build.Repository.Uri) | |
export REF=$(Build.SourceVersion) | |
export FOLDERS='${{ parameters.folders }}' | |
git version | |
git lfs version | |
git init | |
git sparse-checkout init --cone | |
git sparse-checkout add $FOLDERS | |
git remote add origin $ORIGIN | |
git config core.sparsecheckout true | |
git config gc.auto 0 | |
git config advice.detachedHead false | |
git config http.version HTTP/1.1 | |
git lfs install --local | |
git config uploadpack.allowReachableSHA1InWant true | |
git config http.extraheader "AUTHORIZATION: bearer $(System.AccessToken)" | |
git fetch --force --no-tags --progress --depth 1 origin develop $REF | |
git checkout $REF --progress --force | |
displayName: Fast sparse Checkout |
This file contains 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
steps: | |
- checkout: none | |
- template: fastCheckout.yaml | |
parameters: | |
folders: 'Folder1 src/Folder2' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment