4 echo $1 |
grep "^[A-Za-z0-9_]*$" &> /dev
/null
5 if [ "$?" != "0" ]; then
6 echo "Invalid branch name. Must be letters, digits, and underscores."
10 PARENT_BRANCH
=`currentbranchname`
12 if ( git branch|
grep "[^ ]$1$" ); then
13 echo "This branch already exists locally."
17 if ( git branch
-r |
grep "[^ ]origin/$1$" ); then
18 echo "This branch already exists remotely."
22 # Change to master, stashing any dirty working copy files
25 # Create the new branch, pull in any existing commits for it from the central server
28 git tag
-m "parent:$PARENT_BRANCH" branch-created.
$1
31 HOOK_POST_CREATE_BRANCH
=.
/`git rev-parse --show-cdup`.socialgit
/hooks
/post-create-branch
32 $
(ls $HOOK_POST_CREATE_BRANCH 2>/dev
/null
) && $HOOK_POST_CREATE_BRANCH