Participate in the 21st day of The November Gwen Challenge, see the details of the event: 2021 last Gwen Challenge

According to my research, the green box is missing because you changed the user’s email, so github is not submitted by you by default. All you have to do is change the email address of the historical commit user. (I had a problem just because I changed my email)

How do you use it to change the mailbox of a user who has previously committed a commit?


View the current commit information

  • git rebase -i HEAD~n

    Displays the n recent commits in chronological order from nearest to far. Git rebase -i HEAD~3 will enter vim mode.

    Because the information I’m merging is the first two pieces of information. The last three pieces of information are definitely invisible.

  • Git rebase -i –root this lists all commit information from far to near.

Modify the

The first to use

git rebase -i --root --committer-date-is-author-date

Committer-date-is-author-date is the committer-date-is-author-date, and the committer-date-is-author-date is the committer-date-is-author-date.

In the figure above, you can see that I changed it to e before the last three, which means edit.

Change pick to e before the commit you want to change, save and exit.

If you can’t modify it, you might need to learn how to use vim.

Press I in the English input state to enter the edit mode, then use the same as Notepad. After the modification, Esc exits editing mode.

Press:, and enter wq to save the modification and exit the file.

Then you’ll get a message:

You can use

Git commit --amend --author=" amend"

Once you enter it, you will enter the modify page, which is also the Vim editor. Save the configuration and exit.

Git rebase –continue after modifying the first file.

Until you are prompted that all modifications are complete.

Successfully rebased and updated refs/heads/master.

Git push origin master -f

After modifying the user’s email, you can see that my green grid has been restored.

See official documentation for more information: git-scm.com/docs/git-re…