Created
June 11, 2018 03:16
-
-
Save SathishN/f9e7c5e6a42967562b40a71f33ce8a79 to your computer and use it in GitHub Desktop.
Powershell script to git pull from origin on all sub directories
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
$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