Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pull all git projects
$gitUser = @(
"$Home\LocalDrive\GitHub",
"$Home\LocalDrive\GitLab",
"$Home\LocalDrive\GitHub_HaloCustomEdition",
"$Home\LocalDrive\GitHub_Hochschule-Luzern",
"$Home\LocalDrive\GitLab_Apoveda",
"$Home\LocalDrive\GitLab_Valora",
"$Home\LocalDrive\GitHub_Abilium",
"$Home\LocalDrive\GitHub_todo-md",
"$Home\LocalDrive\GitHub_Mint-System",
"$Home\LocalDrive\GitLab_Mint-System"
)
# clear screen
clear
$gitUser | ForEach-Object {
$userName = (Get-Item $_).Name
# get repos for each git user
Get-ChildItem $_ | ForEach-Object {
$repoName = $_.Name
Write-Host "Run git pull for $userName / $repoName"
cd $_.FullName
& git fetch --all
& git reset --hard origin/master
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.