Last active
December 5, 2024 12:01
-
-
Save mrexodia/5a23ab69639a6abc343ac0415958947a to your computer and use it in GitHub Desktop.
Revisions
-
mrexodia revised this gist
Dec 5, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ else exit 1 fi if [ "$MAIN" = "$FEATURE" ]; then echo "Already on $MAIN" >&2 exit 0 fi -
mrexodia created this gist
Dec 5, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash FEATURE=$(git branch --show-current) if git show-ref --quiet refs/remotes/origin/main; then MAIN=main elif git show-ref --quiet refs/remotes/origin/master; then MAIN=master else echo "No main branch found" >&2 exit 1 fi if "$MAIN" == "$FEATURE"; then echo "Already on $MAIN" >&2 exit 0 fi git fetch origin --prune git checkout $MAIN git pull git branch --delete $FEATURE