Files
30-seconds-of-code/snippets/commit-amend-author.md
Angelos Chalaris fb4b6fbc8e Update covers
2023-02-16 22:24:37 +02:00

582 B

title, tags, author, cover, firstSeen
title tags author cover firstSeen
Change the last commit's author commit chalarangelo symmetry-cloudy-mountain 2022-05-03T05:00:00-04:00

Updates the last commit's author without changing its contents.

  • Use git commit --amend to edit the last commit.
  • Use the --author option to change the <name> and <email> of the commit's author.
git commit --amend --author="<name> <email>"
# Make some changes to files
git add .
git commit --amend --author="Duck Quackers <cool.duck@qua.ck>"
# The last commit's author is now `Duck Quackers`