Skip to content

Instantly share code, notes, and snippets.

@topogigiovanni
Created April 1, 2022 11:55
Show Gist options
  • Select an option

  • Save topogigiovanni/160c73935a064d545d2945d662aa1188 to your computer and use it in GitHub Desktop.

Select an option

Save topogigiovanni/160c73935a064d545d2945d662aa1188 to your computer and use it in GitHub Desktop.
Deletar todos os commits de um repositório no git
Checkout
git checkout --orphan latest_branch
Add all the files
git add -A
Commit the changes
git commit -am "commit message"
Delete the branch
git branch -D main
Rename the current branch to main
git branch -m main
Finally, force update your repository
git push -f origin main
PS: this will not keep your old commit history around
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment