From aebfeb1161030143679733fc7944a17f522fc6a9 Mon Sep 17 00:00:00 2001 From: teldra Date: Sun, 26 Jun 2022 17:59:18 +0200 Subject: [PATCH] small fixes --- push.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/push.sh b/push.sh index 47f1ac3..413e8f1 100755 --- a/push.sh +++ b/push.sh @@ -1,7 +1,19 @@ #!/bin/bash -echo funzte nicht -exit 1 -git add content/news + +date="$(date +%Y-%m-%d)" +changedfiles=$(git diff --name-status|awk '{print $2}') + +if ! git switch "${date}"; then + git switch -c ${date} upstream/main +fi + +git pull --rebase upstream main +git add . +git commit -m "${date}: ${changedfiles}" +git push origin --set-upstream origin/main + +exit +git add content/posts git commit --amend --no-edit target="origin" force="-f"