Rebasing a single commit

87 views Asked by At

I have accidentally amended a previous commit (that has been pushed to origin by another person).

What I would now like to do is to rebase my branch on top of origin, without having to resolve merge issues. I.e. I want my coworkers commit to be preserved and all changes of mine to be accepted. is there an easy way to do this on the command line without going through all the lines and choosing my lines over the lines of the this other commit?

1

There are 1 answers

0
UncleZeiv On

There's an option to the recursive merge strategy that lets you do just that:

git merge otherbranch -X ours