Skip to content

Instantly share code, notes, and snippets.

@goforbroke1006
Created July 15, 2021 13:56
Show Gist options
  • Save goforbroke1006/d1deba8dcc7af8ae77cdb5e6939279ed to your computer and use it in GitHub Desktop.
Save goforbroke1006/d1deba8dcc7af8ae77cdb5e6939279ed to your computer and use it in GitHub Desktop.
#!/bin/bash
git reset --hard HEAD~10 # move to old commit (HEAD minus 10)
git merge --squash HEAD@{1} # merge all new commits posted after old commit
git commit -m "Initial commit" # set commit message
git push --force # force push to ignore origin commits' history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment