Last active
August 29, 2015 14:14
-
-
Save Glutexo/98a962688bf925b7fd9e to your computer and use it in GitHub Desktop.
GIT: Remove # from the end of the name of all branches that end with it.
This file contains 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 characters
#!/bin/sh | |
if [ $1 = "-f" ] | |
then | |
FORCE="$1" | |
TRAILING_PATTERN="$2" | |
else | |
FORCE="" | |
TRAILING_PATTERN="$1" | |
fi | |
git branch | grep "$TRAILING_PATTERN$" | sed -E "s/^[* ]+ ((.+)$TRAILING_PATTERN)$/\1 \2/g" | xargs -L1 git branch -m "$FORCE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment