Last active
December 27, 2015 09:39
-
-
Save tjsingleton/7305201 to your computer and use it in GitHub Desktop.
Git helpers I install to ~/bin
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 | |
usage (){ | |
echo "Usage: $0 new-branch-name" | |
exit 1 | |
} | |
[[ $# -eq 0 ]] && usage | |
git fetch origin | |
git checkout origin/master -b "$1" | |
git push origin -u $1 | |
echo "Feature Branch $1 created." | |
exit 0 |
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 | |
usage (){ | |
echo "Usage: $0 remote new-branch-name" | |
exit 1 | |
} | |
[[ $# -lt 2 ]] && usage | |
remote=$1 | |
branch=$2 | |
git fetch $remote | |
git checkout $remote/master -b "$branch" | |
git push origin -u $branch | |
echo "Hotfix $branch created from $remote." | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment