bunteshaus.de/push.sh
2022-06-26 18:33:16 +02:00

27 lines
510 B
Bash
Executable File

#!/bin/bash
if ! git switch "${date}"; then
git switch -c ${date}
fi
date="$(date +%Y-%m-%d)-test"
changedfiles=$(git diff --name-status|awk '{print $2}')
set -x
git add . && \
git commit -m "${date}: ${changedfiles}" && \
git pull --rebase upstream main && \
git push --set-upstream origin origin/main && \
git switch main
exit
git add content/posts
git commit --amend --no-edit
target="origin"
force="-f"
if [ "$1" = "upstream" ]; then
target=upstream
force=""
fi
git push ${target} ${force}