Skip to content

Instantly share code, notes, and snippets.

@geralexgr
Last active February 28, 2022 08:53
Show Gist options
  • Save geralexgr/f932d1126af5ba1dc4f9797218dd6e97 to your computer and use it in GitHub Desktop.
Save geralexgr/f932d1126af5ba1dc4f9797218dd6e97 to your computer and use it in GitHub Desktop.
automatically update git repositories
#change your github location
$github_directory = "C:\Users\galexiou\Documents\GitHub"
Get-ChildItem $github_directory | ForEach-Object {
if($_.Attributes -eq "Directory")
{
Write-Host $_.FullName
Set-Location $_.FullName
git fetch
git pull
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment