Skip to content

Instantly share code, notes, and snippets.

@retohugi
Created December 6, 2018 21:26
Show Gist options
  • Save retohugi/22175b6afe3e1b2747eb6183378857b5 to your computer and use it in GitHub Desktop.
Save retohugi/22175b6afe3e1b2747eb6183378857b5 to your computer and use it in GitHub Desktop.
Powershell script to update all local Git repositories
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