git modify a commit

git log find the hash value of commit, press q to end
Insert picture description here

git rebase -i <short commitID>
Insert picture description here

Enter the vim editor and press i to edit and modify
Insert picture description here

Change the pick you want to modify before submission to reword. If you need to modify multiple picks, you can also change the corresponding multiple picks to reword,
press the ESC key and then press shift: (lowercase) wq and then type wq (w is for saving, q Yes to exit) Press Enter

At this time, you can modify it, and modify the content you want to modify in the yellow font of the head.
Insert picture description here

After modifying, exit and save and press esc to exit editing: wq save and exit the entire editor
git rebase --continue merge conflict
Insert picture description here

git log Check if the modification is successful
Push back to git git pull git push This is the synchronous modification
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_48371382/article/details/109616685