Created
April 16, 2020 18:06
-
-
Save janikvonrotz/cb2dc91bbf8923f659d4ea148c906588 to your computer and use it in GitHub Desktop.
Pull all git projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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