From aa5efec6db302ba360922d7d4ebf67eafb79ee2a Mon Sep 17 00:00:00 2001 From: Chalarangelo Date: Sun, 1 May 2022 13:06:43 +0300 Subject: [PATCH] Add commit amend author --- snippets/commit-amend-author.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 snippets/commit-amend-author.md diff --git a/snippets/commit-amend-author.md b/snippets/commit-amend-author.md new file mode 100644 index 000000000..f7f6c5813 --- /dev/null +++ b/snippets/commit-amend-author.md @@ -0,0 +1,23 @@ +--- +title: Change the last commit's author +tags: commit +expertise: intermediate +author: chalarangelo +firstSeen: 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 `` and `` of the commit's author. + +```shell +git commit --amend --author=" " +``` + +```shell +# Make some changes to files +git add . +git commit --amend --author="Duck Quackers " +# The last commit's author is now `Duck Quackers` +```