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"