GIT

From Hugo Villeneuve
Revision as of 00:05, 19 February 2013 by Hugo (talk | contribs)
Jump to: navigation, search
#!/bin/bash

# git-create-branch <branch_name>

if [ $# -ne 1 ]; then
    echo 1>&2 Usage: $0 branch_name
    exit 1
fi

branch_name=$1

git checkout -b ${branch_name}

git push origin ${branch_name}

git branch --set-upstream ${branch_name} origin/${branch_name}
  1. To delete the remote branch:
  2. git push origin :${branch_name}