Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Checkout master branch
git checkout master
# Rename "master" to "main"
git branch -m master main
# Unset the current upstream branch
git branch --unset-upstream
# Publish the "main" branch as upstream
git push origin -u main
# Delete the "master" branch from origin
# Note that this will cause an error from GitHub unless you go
# to the repo settings and change the default branch to "main"
git push origin --delete master
@tarngerine

This comment has been minimized.

Copy link

@tarngerine tarngerine commented Jun 15, 2020

ohyeeeeeeeeeeeeeeeee thx u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment