Monday, June 20, 2011

Add Branch to Git.

--------------------------------------------------------
vi  /usr/bin/addbranch   <---Create the file with name, and copy the following code.

#!/bin/bash
# git-create-branch

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

set branch_name = $1
#git push origin origin:refs/heads/${branch_name}
#git fetch origin
git checkout --track -b ${branch_name} origin/${branch_name}
git pull

--------------------------------------------------------------




Do
chmod 777 /usr/bin/addbranch


and create new branch like:
from checkouted code.

addbranch