Skip to content

Instantly share code, notes, and snippets.

@jonnybest
Created August 30, 2011 06:41
Show Gist options
  • Select an option

  • Save jonnybest/1180336 to your computer and use it in GitHub Desktop.

Select an option

Save jonnybest/1180336 to your computer and use it in GitHub Desktop.
Powershell update script for multiple git repositories
if (!$git) {
Write-Host "This is probably the first time you run this script.
Please enter the path to git.cmd or git.exe:";
$git = Read-Host;
Set-Variable -Name git -Value $git -Scope 1;
}
else {
Write-Host "Git is located at " $git;
# Something like "C:\Program Files\Git\cmd\git.cmd"
}
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