summaryrefslogtreecommitdiffstats
path: root/checkout-branch.sh
blob: cdb9ab4588fe41600787e8e169cd0d18e3b56596 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

#checks out the given branch

if [ "$1" = "" ] ; then
        echo "please provide one of the branch names:"
        git branch -a
        exit
fi

git checkout -b $1 origin/$1
git config branch.$1.remote origin
git config branch.$1.merge refs/heads/$1