Created
December 6, 2018 21:26
-
-
Save retohugi/22175b6afe3e1b2747eb6183378857b5 to your computer and use it in GitHub Desktop.
Powershell script to update all local Git repositories
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-host "Start looking for Git repositories in $PWD..." | |
Get-ChildItem -Recurse -Force | | |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } | | |
ForEach-Object { | |
cd $_.FullName | |
cd ../ | |
Write-Host "Pull remote from $PWD." | |
git checkout master | |
git pull origin master | |
cd ../ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment