Compare commits

...

5 Commits

Author SHA1 Message Date
42e62e9297 Merge branch 'main' into rotom 2026-01-10 17:27:01 +01:00
caac420894 cherry-merge script fix 2026-01-10 17:26:52 +01:00
636c6a1917 cherry-merge script 2026-01-10 17:26:38 +01:00
5d20fc669f cherry-merge script fix 2026-01-10 17:25:56 +01:00
c5c6d93689 cherry-merge script 2026-01-10 17:20:55 +01:00
2 changed files with 31 additions and 0 deletions

View File

@@ -9,3 +9,9 @@ alias girlboss="sudo"
alias vialias="nvim $HOME/.oh-my-zsh/custom/aliases.zsh"
alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
#############
## Scripts ##
#############
alias cherry-merge="$ZSH_CUSTOM/scripts/cherry-merge.sh"

View File

@@ -0,0 +1,25 @@
#!/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 cant merge main into main, silly"
exit 1
fi
echo "Target branch: $TARGET_BRANCH"
sleep 2
git switch "$MAIN_BRANCH" || exit 1
git cherry-pick "$TARGET_BRANCH" || exit 1
git switch "$TARGET_BRANCH" || exit 1
git merge "$MAIN_BRANCH" || exit 1