Last active
June 23, 2020 10:43
-
-
Save abompard/d7093d210020cd39d9b2b681778e6be8 to your computer and use it in GitHub Desktop.
Rename the git master branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OLD=master | |
NEW=dev | |
ORIGIN=`git remote -v | awk '/git@github.com:fedora-infra/ {print $1}' | head -1` | |
set -e -x | |
git fetch -p ${ORIGIN} | |
git branch -m ${OLD} ${NEW} | |
git branch -u ${ORIGIN}/${NEW} ${NEW} | |
git remote set-head ${ORIGIN} -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment