bunteshaus.de/push.sh

26 lines
477 B
Bash
Raw Normal View History

#!/bin/bash
2022-06-26 17:59:18 +02:00
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
2022-04-08 18:33:14 +02:00
git commit --amend --no-edit
target="origin"
2022-04-08 18:46:49 +02:00
force="-f"
2022-04-08 18:42:39 +02:00
if [ "$1" = "upstream" ]; then
2022-04-08 18:33:14 +02:00
target=upstream
2022-04-08 18:46:49 +02:00
force=""
2022-04-08 18:33:14 +02:00
fi
2022-04-08 18:46:49 +02:00
git push ${target} ${force}