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 characters
| #!/usr/bin/env bash | |
| DEFAULT_BRANCH=`git rev-parse --abbrev-ref origin/HEAD | cut -f 2 -d /` | |
| git branch --merged ${DEFAULT_BRANCH} | grep -v "${DEFAULT_BRANCH}\|support" | xargs git branch -d && git remote prune origin |
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 characters
| class Enum { | |
| constructor(items, startAt = 0) { | |
| if (startAt < 0) { | |
| throw new Error("startAt must be greater than or equal to zero"); | |
| } | |
| try { | |
| items.forEach((item, i) => { | |
| this[item] = i + startAt; | |
| }); |
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 characters
| #!/usr/bin/env bash | |
| if [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" != "true" ] | |
| then | |
| echo "The current directory is not a git repository." | |
| exit 0 | |
| fi | |
| DEFAULT_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD | cut -f 2 -d /) | |
| CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) |
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 characters
| mkdir -p bundles | |
| for D in ./*; do | |
| if [ -d "$D" ]; then | |
| cd "$D" | |
| FILENAME=$(basename "$(pwd)").bundle | |
| git bundle create $FILENAME --all | |
| mv $FILENAME ../bundles/ |
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 characters
| OLD_USERNAME=rwpcpe | |
| NEW_USERNAME=russellwpatterson | |
| for D in ./*; do | |
| if [ -d "$D" ]; then | |
| cd "$D" | |
| OLD_URL=$(git remote get-url origin) | |
| NEW_URL=$(echo $OLD_URL | sed "s/$OLD_USERNAME/$NEW_USERNAME/") | |
| if [ "$OLD_URL" != "$NEW_URL" ]; then |
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 characters
| OLD_USERNAME=rwpcpe | |
| NEW_USERNAME=russellwpatterson | |
| OLD_URL=$(git remote get-url origin) | |
| NEW_URL=$(echo $OLD_URL | sed "s/$OLD_USERNAME/$NEW_USERNAME/") | |
| git remote set-url origin $NEW_URL | |
| echo Replaced $OLD_URL with $NEW_URL |