Skip to content

Instantly share code, notes, and snippets.

@drabb
Created August 23, 2023 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drabb/76b12b9cdc85c1f0a4b91e2e564747f7 to your computer and use it in GitHub Desktop.
Save drabb/76b12b9cdc85c1f0a4b91e2e564747f7 to your computer and use it in GitHub Desktop.
feature_branch
#!/bin/bash
if [[ "$1" == "-c" ]]; then
git checkout "$(git branch | awk '{$1=$1};1' | awk '!/\*/ {print $0}' | gum choose --height=20)" && git pull
else
#PREFIX=$(gum input --placeholder "Prefix" --value "CU")
PREFIX="CU"
TASK=$(gum input --placeholder "ClickUP Task ID")
TASK="${PREFIX}-${TASK:1}"
DESC=$(gum input --placeholder "Snake case feature name")
branch="${TASK}_${DESC}"
gum spin -s line --title "Pulling latest changes from master" -- git com
gum spin -s line --title "Creating new feature branch ${branch} from master" -- git checkout -b $branch
gum style --foreground 212 "Done!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment