How to pull a commit from git history?

I am confused how to fix my problem. My git history is like this (commit id):

commit: f8ae2 -> parent: 71bf9 
commit: 71bf9 -> parent: f67c0 
commit: f67c0 -> parent: 5b18a 
commit: 5b18a -> parent: 9e111 
commit: 9e111 -> parent: ce53b
commit: ce53b -> parents: f1b1a, 2055e
commit: f1b1a -> parent: 2055e
commit: 2055e

      

Since I'm the only person working on a branch and still not upstream merged, I want to pull or delete commit: f1b1a

from history. So I only want to commit: ce53b

have it 2055e

as a parent.

What should I do? Any suggestion will be greatly appreciated. thank.

+3


source to share


1 answer


You can use the interactive redirect for this: run

git rebase -i --onto 2055e 2055e

      



then remove every line you don't want in your history.

+3


source







All Articles