1

With git, I know that rebasing will recreate the commits that are being rebased, thus creating completely new sha values for each commit.

Is rebasing the only way to destroy existing sha values ?

CodeWizard
  • 110,388
  • 20
  • 126
  • 153
Ivar
  • 4,722
  • 2
  • 32
  • 42

1 Answers1

4

There are many ways to do it as well which are not described here as well.

  • checkout / revert /reflog / reset
    Read it all here: How to move HEAD back to a previous location? (Detached head)

  • git filter-branch
    This command alter your history and allow you to delete commits as well.

  • git rebase / git rebase -i HEAD~x
    Here you can squash several commits into a new commit

  • BFG Repo-Cleaner Removes large or troublesome blobs like git-filter-branch does, but faster.

BFG Repo-Cleaner

Community
  • 1
  • 1
CodeWizard
  • 110,388
  • 20
  • 126
  • 153