Skip to content

Instantly share code, notes, and snippets.

@chanian
Created December 2, 2010 20:55
Show Gist options
  • Save chanian/726045 to your computer and use it in GitHub Desktop.
Save chanian/726045 to your computer and use it in GitHub Desktop.
Painless feature branch creation for all!
#!/bin/sh
if [ ! -d ./.git ]
then
echo "Not a git repository"
exit
fi
if [ $# -ne 1 ]
then
echo "Please provide a branch name to create and switch to"
exit
fi
git checkout master && git pull && git push origin origin:refs/heads/$1 && git checkout --track -b $1 origin/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment