Skip to content

Instantly share code, notes, and snippets.

@samiru
Forked from vermorel/git-fetch-rebase-subdirectories.psh1
Last active December 16, 2022 10:43
Show Gist options
  • Select an option

  • Save samiru/80a80916a1d1ebabf7b472f3aecca1b0 to your computer and use it in GitHub Desktop.

Select an option

Save samiru/80a80916a1d1ebabf7b472f3aecca1b0 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 pull on each sub directory.
Tags: #bin
#>
$initpath = Get-Location
foreach($path in Get-ChildItem) {
if ($path.Attributes -eq "Directory") {
Set-Location $path.FullName
git pull
}
}
Set-Location $initpath
@llodiaking
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment