2

I do not want to merge because this is the problem.

Let's say my repository looks like this: (letter's are commits)

A B C D E F G

'A' is the head. And I have two commits ('E' and 'C' that I want to get rid of). If I just remove those particular two commits, I then just get two more commits on top of the head telling me I reverted two commits. I don't want that. I want my repository to look just like the remote repository I am forked to.

The problem is I can't get any work done because every time I push a commit, it also pushes commits 'E' and 'C'.

I need help. I have done countless research and every answer I find is some abstract solution/series of commands with no explanation to them and I can't tell if it's what I need.

1 Answer 1

0

Have you tried:

git rebase -i A

And discard the commits C and E

You might have a problem though as you have pushed them to the remote before, you can't really rewrite history if you pushed to a remote already. I mean you can, but people who have pulled after you pushed will have a problem as all of a sudden their history isn't the same as the remote history.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .