diff --git a/push-updates.ps1 b/push-updates.ps1 new file mode 100644 index 0000000..8403880 --- /dev/null +++ b/push-updates.ps1 @@ -0,0 +1,31 @@ +param( + [string]$RepoPath = "C:\Users\Kevkus\Desktop\Obsidian\Allgemeine D&D Notizen\DND Zeug" +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = "Stop" + +# Datum/Time für Commit-Message (lokal, ISO-ish) +$stamp = Get-Date -Format "yyyy-MM-dd HH:mm" + +Set-Location $RepoPath + +# Optional: erst pull, um Konflikte zu vermeiden (kannst du auch auskommentieren) +# git pull --rebase + +# Add alles +git add -A | Out-Null + +# Prüfen ob überhaupt Änderungen da sind +$changes = git status --porcelain +if ([string]::IsNullOrWhiteSpace($changes)) { + Write-Host "Keine Änderungen – nichts zu committen/pushen." + exit 0 +} + +# Commit + Push +$msg = "Automatischer Push von $stamp" +git commit -m $msg | Out-Null +git push | Out-Null + +Write-Host "OK: $msg" \ No newline at end of file