0

On my local repo I have an origin and upstream remote repositories. Origin is a forked repo or upstream. To update my origin I run the command git pull --rebase upstream master and that will make my origin be the same as upstream. This time its not working. I must have about 7-8 commits that have not been rebased. I am trying to delete them but can't find any ways. I have Googled and looked here but any suggestions I tried just did not work.

I have the workflow A - B - C - D - E, each letter representing a commit on master. I want to remove commits B, C and D. Is there a way I can do this?

1

1 Answer 1

1

You have commits A - B - C - D - E. You can use git rebase -i HEAD~5 (up to the parent of first removed commit - i.e. A), then delete lines with commits you want to remove (leave lines with A and E), then save.

More info on interactive rebase: https://hackernoon.com/beginners-guide-to-interactive-rebasing-346a3f9c3a6d

Sign up to request clarification or add additional context in comments.

1 Comment

Tried something similar yesterday and it didn't work, but worked a treat this morning, thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.