Last active
July 14, 2024 04:17
-
-
Save gesslar/5992413395060e2f36b68091827c0c96 to your computer and use it in GitHub Desktop.
updates all local repos - useful after doing things directly online or dependencies got updated
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
# Define the array of directories | |
$repos = @( | |
"mud.gesslar.dev", | |
"mupdate", | |
"ThreshBeep", | |
"ThreshBuff", | |
"ThreshChat", | |
"ThreshColorPercent", | |
"ThreshCommandRepeater", | |
"ThreshCopy", | |
"ThreshKeepalive", | |
"ThresholdUI", | |
"ThreshURL" | |
) | |
# Base directory | |
$baseDir = "D:\git" | |
# Iterate through each directory and perform git pull | |
foreach ($repo in $repos) { | |
$repoPath = Join-Path -Path $baseDir -ChildPath $repo | |
if (Test-Path -Path $repoPath) { | |
Write-Output "Pulling latest changes in $repo" | |
Set-Location -Path $repoPath | |
git pull | |
git add . | |
git commit -m "Updating" | |
git push | |
} else { | |
Write-Output "Directory $repoPath does not exist" | |
} | |
} | |
# Reset location to the original working directory | |
Set-Location -Path $baseDir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment