forked from Bunteshaus/bunteshaus.de
27 lines
516 B
Bash
Executable File
27 lines
516 B
Bash
Executable File
#!/bin/bash
|
|
|
|
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 -f origin --set-upstream 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}
|