Git rebase – I method of modifying history submission


Git rebase – I modify history commit

commit 3 add 22222

commit 2 add 11111

commit 1 create file

We have submitted the above three times and found that the second submission has errors, so we are ready to modify the second submission.

Git log – oneline view head

f206555 add 2222

572a41e add 1111

c195175 feat:create file

Git rebase – I c195175 goes back to the first submission

Enter command mode

Choose to proceededit

Now it’s back to the first submission

Modify the text


View git status

Submit the new changes according to the status prompt

git add . 
git commit –amend

(the original submission is still usedadd 1111)

Git status view git status


The prompt says use git rebase – continue to save the changes you just made

git rebase –continue

Prompt for some problems with the results, and then continue with git rebase – continue

At this point, there is a conflict. You need to resolve the conflict and continue

Resolve the conflict and check the GIT status
Git add is required
Do git add. Then continue to check the GIT status

git rebase –coninue


Continue git rebase – continue if there is no conflict, you can go back to the master, otherwise you need to continue to resolve the conflict.

Take a look at git log and the current text

This article introduces the method of GIT rebase – I modification history submission. For more relevant git rebase – I modification history submission content, please search the previous articles of developeppaer or continue to browse the related articles below. I hope you can support developeppaer more in the future!