Skip to content

Instantly share code, notes, and snippets.

@vermorel
Created April 25, 2012 11:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vermorel/2489148 to your computer and use it in GitHub Desktop.
Save vermorel/2489148 to your computer and use it in GitHub Desktop.
Iterate through subdirectories in PowerShell and perform 'git fetch' and 'git rebase' each time
<#
Iterate through all subdirectories, and perform Git fetch, then Git rebase
on each subdirectory.
Joannes Vermorel, 2012-04-25
#>
$initpath = get-location
foreach($path in get-childitem) {
if ($path.Attributes -eq "Directory") {
set-location $path.FullName
git fetch
git rebase
}
}
set-location $initpath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment