Automatischer Push von 2026-03-01 06:19
This commit is contained in:
31
push-updates.ps1
Normal file
31
push-updates.ps1
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user