Skip to content

Instantly share code, notes, and snippets.

@geoffkip
Forked from jonnybest/update-coapp.ps1
Created April 10, 2017 17:27
Show Gist options
  • Select an option

  • Save geoffkip/1da589b5eb62f31cff12c0137615de3e to your computer and use it in GitHub Desktop.

Select an option

Save geoffkip/1da589b5eb62f31cff12c0137615de3e to your computer and use it in GitHub Desktop.
Powershell update script for multiple git repositories
$git = $env:programfiles+"\Git\cmd\git.cmd";
if (!$git) {
Write-Host "Something went wrong.
Please enter the path to git.cmd or git.exe:";
$git = Read-Host;
Set-Variable -Name git -Value $git;
}
ls -name -Exclude *.* | foreach {cd .\$_ ; .$git pull origin master ; cd ..}
Write-Host "Done.";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment