Table of Contents
Modify a commit which has been pushed
Steps
Demo Video
Modify a commit which has been pushed
Active
Draft
Obsolete
Ongoing
Review
Introduce how to modify a commit which has been pushed.
Steps
Find the ID (denoted by
pre-cmt-id
) of the previous commit of the commit that you need to modify.
Run
git rebase -i
pre-cmt-id
.
Modify
pick
to
edit
in the line where the commit to be modified is located. Then save and exit.
Make changes.
Run
git add
…
.
Run
git commit --amend
.
Run
git push
…
if you want to push changes to remote.
Run
git rebase --continue
.
Demo Video