Skip to content

Instantly share code, notes, and snippets.

@janikvonrotz
Created April 16, 2020 18:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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