Created
January 24, 2023 12:40
-
-
Save skolima/375b89b4c557cfe67d71a6624e38642b to your computer and use it in GitHub Desktop.
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
Write-Output "Pulling in latest changes for all repositories..." | |
# Find all git repositories and update it to the master latest revision | |
Get-ChildItem -Directory -Recurse -Force -Filter ".git" | ForEach-Object { | |
Write-Output "Checking " $_.FullName | |
Push-Location -Path $_ | |
# We have to go to the .git parent directory to call the pull command | |
Set-Location .. | |
# finally pull | |
git checkout main || git checkout master | |
git fetch --all --prune | |
git merge origin/main --ff-only || git merge origin/master --ff-only | |
Pop-Location | |
} | |
Write-Output "Complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment