Skip to content

Instantly share code, notes, and snippets.

@anthonydahanne
Created April 24, 2023 21:19
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 anthonydahanne/c0bea4ff0fe6525b499eb0bfeca6a545 to your computer and use it in GitHub Desktop.
Save anthonydahanne/c0bea4ff0fe6525b499eb0bfeca6a545 to your computer and use it in GitHub Desktop.
Github has disabled force-push to the main branch; except that sometimes, that can come in handy. Use this gist with care ❤️
git checkout -b other-main
git push origin other-main
gh api -XPATCH "repos/pivotal-cf/tanzu-bellsoft-liberica" -f default_branch="other-main" >/dev/null
git push --delete tanzu main
gh api "repos/pivotal-cf/tanzu-bellsoft-liberica/branches/other-main/rename" -f new_name="main" >/dev/null
git checkout main
git pull origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment