Skip to content

Instantly share code, notes, and snippets.

@SathishN
Created June 11, 2018 03:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SathishN/f9e7c5e6a42967562b40a71f33ce8a79 to your computer and use it in GitHub Desktop.
Save SathishN/f9e7c5e6a42967562b40a71f33ce8a79 to your computer and use it in GitHub Desktop.
Powershell script to git pull from origin on all sub directories
$dirs = ls -name -Exclude *.*;
Write-Host 'Base Dir : ' (get-location) -ForegroundColor yellow ;
foreach($dir in $dirs) {
cd $dir;
if(Test-Path ".\.git") {
Write-Host 'Git pull from orgin on :' (get-location) -ForegroundColor Magenta;
&git.exe pull -v --no-rebase "origin" 2> $null
}
cd ..;
}
Write-Host "Done." -ForegroundColor green;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment