ThomasGHenry
9/15/2017 - 5:06 PM

rename git branch locally and remotely

rename git branch locally and remotely

OLDB=$1
NEWB=$2
git pull || exit
git branch -m ${OLDB} ${NEWB}            # Rename branch locally    
git push origin :${OLDB}                 # Delete the old branch    
git push --set-upstream origin ${NEWB}   # Push the new branch, set local branch to track the new remote