Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete commits with egit?

Tags:

git

eclipse

egit

I just made some bad commits with egit that I would like to delete.

Some bad commits I want to delete

How do I delete commits from egit?

Thanks!

EDIT: I tried a hard reset a few times but it didn't do anything. Hard reset screen

EDIT 2: Hard reset does rollback changes indeed, but I want them to completely disappear from the history as if I never made these commits.

like image 815
stommestack Avatar asked Nov 23 '12 18:11

stommestack


1 Answers

RightMouse on your Repository and click on "show in -> history". You should select the last commit before your last "fetch"...most of the time its the second commit under your current HEAD. RightMouse on that commit and "reset -> Hard" (will reset all your commits AND local workspace changes to the selected commit).

you should see the up-arrow changing into an down-arrow, meaning that your commits are deleted and that your repository is outdated. Use "fetch" & "rebase" to be up to date.

like image 198
Frank Avatar answered Oct 14 '22 02:10

Frank