Skip to content

Instantly share code, notes, and snippets.

@tjsingleton
Last active December 27, 2015 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjsingleton/7305201 to your computer and use it in GitHub Desktop.
Save tjsingleton/7305201 to your computer and use it in GitHub Desktop.
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