28 lines
646 B
PowerShell
28 lines
646 B
PowerShell
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" |