Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Last active November 14, 2025 23:32
Show Gist options
  • Select an option

  • Save kmcquade/b2f8190c146073930f9086786d062a33 to your computer and use it in GitHub Desktop.

Select an option

Save kmcquade/b2f8190c146073930f9086786d062a33 to your computer and use it in GitHub Desktop.
hiro.sh
git checkout --orphan newBranch; \
git add -A; \ # Add all files and commit them
git commit -m "Cleanup"; \
git branch -D main; \ # Delete the main branch
git branch -m main; \ # Rename the current branch to main
git push -f origin main; \ # Force push main branch to GitHub
git gc --aggressive --prune=all # Remove the old files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment