Files
scriptkiddie/push-updates.ps1
2026-03-01 06:41:26 +01:00

28 lines
646 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
# 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"