Created
March 27, 2018 20:11
-
-
Save michaelkc/3b4ebadc98088c2ac9e53c88b99b0d0b to your computer and use it in GitHub Desktop.
Powershell variant of the git-pull-all command, to pull all git repos in subfolders of current folder
This file contains hidden or 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
$git = "git.exe" # or change to absolute path if not in PATH | |
$gitRepos = Get-ChildItem -Recurse -Directory | Where-Object { Get-ChildItem $_.FullName -Directory -Hidden -Filter ".git" } | |
foreach ($gitRepo in $gitRepos) | |
{ | |
Write-Host "Pulling $($gitRepo.Fullname)" | |
pushd | |
cd $gitRepo.Fullname | |
&$git pull | |
popd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment