문제

I've made a pull with rebase:

git pull --rebase

After two commits were successfully applied I started applying the third one. It the middle of this I realized that I did it wrong and it would be good to undo it. Of course I can do git

rebase --abort

but then I'll loose all the work I've done (two applied commits).

Is there any way to undo the process of applying current commit during rebase and start merging again?

도움이 되었습니까?

해결책

You can do a

git rebase --skip

(perhaps multiple times)

That way, your applied commits will be saved. However at that point your third commit will be hidden, so follow up with:

git branch old-commit ORIG_HEAD

to have access to your other (third an following) commits.

For finishing touch, you could do

git checkout old-commit && git rebase --interactive HEAD...master

and remove the successfully rebased commits.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top