github

How can modifiy last commit user details In Git

  • Profile picture of Mcs
  • by Mcs July 15, 2025

Change Author Info of the Last Commit

git commit --amend --author="New Name <new.email@example.com>"

This allows you to change the author of the most recent commit.

Then Push the Change (if already pushed)
If you've already pushed the commit to a remote, you must force-push the amended commit:

git push --force

Comments

Add new comment

Restricted HTML

  • Allowed HTML tags: <br> <p> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <cite> <dl> <dt> <dd> <a hreflang href> <blockquote cite> <ul type> <ol type start> <strong> <em> <code> <li>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.