First find your commit:
$ git log
Then copy the last commit ID (one commit after your target commit. it means your target commit + 1).
Then start rebase:
$ git rebase -i 234234rfsdfrq3213412e412
This command will open your EDITOR, change your target commits from pick
to edit
. THIS ACTION IS SO IMPORTANT
Then save and close your editor.
Then amend your commit (with your details):
$ git commit --amend --author="Morteza Nourelahi Alamdari <[email protected]>"
Then keep rebase continue:
$ git rebase --continue
Again try do amend line. Again try keep rebase continue line.
Until rebase command says (all edit
lines completed successfully):
Successfully rebased and updated
Now your commits are changed successfully.
Now if you want to push your commits to the server, try to push it with -f
option:
$ git push origin master -f
How do you this for all commits. Thank you