0

I am looking to remove historical commits dbf41fc and 6136562 without destroying the latest commit 070831a.

enter image description here

C-Otto
  • 4,941
  • 3
  • 25
  • 60
h3110
  • 55
  • 3
  • 1
    Do you know about interactive rebase already? – C-Otto Jan 23 '18 at 13:46
  • What exactly do do mean by "destroy"? You can rebase and remove some commits - this will preserve the changes from 070831a, however 070831a will get a different commit id. You may get a conflict during the rebase, if 070831a has changed lines, touched by either dbf41fc or 6136562. It's impossible to change parent commits AND having their upcoming child commit ids unchanged. – Rudolf Tucek Jan 23 '18 at 14:15
  • Cherry pick 070831a onto 6136562's parent? – evolutionxbox Jan 23 '18 at 15:31
  • If it's a shared repository, you can try git revert(commits you want to remove). This way others won't curse you for force update. But if there is some sensitive data then go ahead with delete – Tarun Chabarwal Jan 23 '18 at 16:52
  • Possible duplicate of [Git - delete older commit like it and its changes never happened](https://stackoverflow.com/questions/42680230/git-delete-older-commit-like-it-and-its-changes-never-happened) – phd Jan 23 '18 at 17:13

0 Answers0