Added push alias
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
19
zsh/.omz-custom/scripts/push-main-current.sh
Executable file
19
zsh/.omz-custom/scripts/push-main-current.sh
Executable 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"
|
||||
Reference in New Issue
Block a user