Skip to content

Instantly share code, notes, and snippets.

@abompard
Last active June 23, 2020 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abompard/d7093d210020cd39d9b2b681778e6be8 to your computer and use it in GitHub Desktop.
Save abompard/d7093d210020cd39d9b2b681778e6be8 to your computer and use it in GitHub Desktop.
Rename the git master branch
#!/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