Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git helpers I install to ~/bin
#!/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
#!/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
You can’t perform that action at this time.