Last active
April 12, 2017 17:38
-
-
Save rscarvalho/b4b15cea7002c743bffce3a3d80fcc4d to your computer and use it in GitHub Desktop.
Git extensions
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 | |
FEATURE_BRANCH=$(git rev-parse --abbrev-ref HEAD| xargs echo -n) | |
TARGET_BRANCH=${1:-master} | |
echo "Cleaning feature branch ${FEATURE_BRANCH} (coming back to ${TARGET_BRANCH})" | |
git checkout ${TARGET_BRANCH} | |
git fetch -ap | |
git pull --rebase | |
git branch -d ${FEATURE_BRANCH} | |
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 | |
FEATURE_BRANCH=$(git rev-parse --abbrev-ref HEAD| xargs echo -n) | |
TARGET_BRANCH=${1:-master} | |
echo "Updating branch ${FEATURE_BRANCH} from ${TARGET_BRANCH}" | |
git checkout ${TARGET_BRANCH} | |
git pull --rebase | |
git checkout ${FEATURE_BRANCH} | |
git rebase ${TARGET_BRANCH} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment