diff --git a/dist/platforms/ubuntu/steps/set_gitcredential.sh b/dist/platforms/ubuntu/steps/set_gitcredential.sh index d572a583..9e24a6f0 100755 --- a/dist/platforms/ubuntu/steps/set_gitcredential.sh +++ b/dist/platforms/ubuntu/steps/set_gitcredential.sh @@ -9,11 +9,14 @@ else git config --global credential.helper store git config --global --replace-all url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf ssh://git@github.com/ git config --global --add url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf git@github.com - git config --global --add url."https://token:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "https://github.com/" + git config --global url."https://ssh:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "ssh://git@github.com/" git config --global url."https://git:$GIT_PRIVATE_TOKEN@github.com/".insteadOf "git@github.com:" + # Enable rewriting urls in lfs based on https://github.com/git-lfs/git-lfs/issues/4173#issuecomment-1367446741 + git config --global lfs.transfer.enablehrefrewrite true + fi echo "---------- git config --list -------------" diff --git a/dist/platforms/windows/set_gitcredential.ps1 b/dist/platforms/windows/set_gitcredential.ps1 index de4d701b..3ce69341 100644 --- a/dist/platforms/windows/set_gitcredential.ps1 +++ b/dist/platforms/windows/set_gitcredential.ps1 @@ -7,10 +7,13 @@ else { git config --global credential.helper store git config --global --replace-all "url.https://token:$env:GIT_PRIVATE_TOKEN@github.com/".insteadOf "ssh://git@github.com/" git config --global --add "url.https://token:$env:GIT_PRIVATE_TOKEN@github.com/".insteadOf "git@github.com" - git config --global --add "url.https://token:$env:GIT_PRIVATE_TOKEN@github.com/".insteadOf "https://github.com/" + git config --global "url.https://ssh:$env:GIT_PRIVATE_TOKEN@github.com/".insteadOf "ssh://git@github.com/" git config --global "url.https://git:$env:GIT_PRIVATE_TOKEN@github.com/".insteadOf "git@github.com:" + + # Enable rewriting urls in lfs based on https://github.com/git-lfs/git-lfs/issues/4173#issuecomment-1367446741 + git config --global lfs.transfer.enablehrefrewrite true } Write-Host "---------- git config --list -------------"