Added push alias

This commit is contained in:
2026-01-13 20:00:01 +01:00
parent 83728cdbe5
commit d13b8756c9
3 changed files with 21 additions and 1 deletions

View File

@@ -16,3 +16,4 @@ alias update-submodules="git submodules update --recursive --init"
#############
alias cherry-merge="$ZSH_CUSTOM/scripts/cherry-merge.sh"
alias push-main-current="$ZSH_CUSTOM/scripts/push-main-current.sh"

View File

@@ -14,7 +14,7 @@ if [ $MAIN_BRANCH == $TARGET_BRANCH ]; then
fi
echo "Target branch: $TARGET_BRANCH"
sleep 2
sleep 1
git switch "$MAIN_BRANCH" || exit 1

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
MAIN_BRANCH="main"
TARGET_BRANCH=$(git branch --show-current)
if [ -z $TARGET_BRANCH ]; then
echo "Cannot find target branch, are you in a git repo?"
exit 1
fi
if [ $MAIN_BRANCH == $TARGET_BRANCH ]; then
echo "You are on main, silly"
exit 1
fi
echo "Target branch: $TARGET_BRANCH"
sleep 1
git push origin "$MAIN_BRANCH" "$TARGET_BRANCH"