12 ms·
Github has nothing to do with that. It's hard to delete commits from git, because of the way it fundamentally works. Part of what defines a commit is its parent
by nathan_long 14y ago
Github has nothing to do with that. It's hard to delete commits from git, because of the way it fundamentally works. Part of what defines a commit is its parent commit (or commits, plural, if it's a merge), and that chain goes back to the beginning of the repo. This means that you can't remove a commit from the history without changing everything that came after.
Well, you can do that, but suddenly no one else who works with your repo will be able to pull changes, because there is no way to reconcile the histories. Think of them as divergent timelines. They're like, "last thing I saw, Obama got re-elected; what's happened since then?", and your modified repo is like, "Uh, I don't know who this 'Obama' fellow is, and don't let the Lizard King hear you talking about elections."