Last active
June 18, 2023 13:10
-
-
Save mnadjit/277ddd5fd6b7cade9d1f27e2708be473 to your computer and use it in GitHub Desktop.
PowerShell scripts to upload or download contents of the directory passed as argument to/from origin
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
$script:cur_dir = (Get-Location) | |
$script:args | % { | |
Set-Location $_ | |
Write-Output "`nDownloading from origin into path: $($_)`n" | |
git fetch --all | |
git reset --hard origin/main | |
git pull --force | |
} | |
Set-Location $cur_dir |
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
$script:cur_dir = (Get-Location) | |
$script:args | % { | |
Set-Location $_ | |
Write-Output "`nUploading to origin from path: $($_)`n" | |
git add --all | |
git commit -am "updated" | |
git push --all --force | |
} | |
Set-Location $cur_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment