Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
@Nikaraqua

This comment has been minimized.

Copy link

@Nikaraqua Nikaraqua commented Jan 26, 2017

I tried that (precisely to do that)

But I typed it in just like that verbatum (did not substitute author for my name or anything)

= went into some sort of editing mode of that committed doc that I was trying to change the auithor of...

This "editing mode" allowed me to write in or about the doc (was a README.md for my first try at committing)

                      At the bottom of the window it showed my current directory plus:
                       .git/COMMIT_EDITMSG [unix] 

And then to get back to the usual CLI, I had to press ESC and then

                       :wq

(I found that on google on a forum after searching above extension...)

But I am still not entirely sure what happened or why...

@antont

This comment has been minimized.

Copy link

@antont antont commented Mar 27, 2017

that's normal -- it means that when git does the commit for you, it allows you to edit the commit message, by default using the Vi editor, which works so that you can exit it by doing :wq

@AlisterH

This comment has been minimized.

Copy link

@AlisterH AlisterH commented May 30, 2017

Doing the global change wasn't enough for me - I had to do git config user.name "..." and git config user.email "..." before trying to amend.

@xyzzy529

This comment has been minimized.

Copy link

@xyzzy529 xyzzy529 commented Jul 11, 2017

There is potentially two user.name values set ... One at the --global config and one on the local repository.
If you git config --list the output will have multiple of the same parameters ... the last one in the list is the one used for your current repo.

@coderhh

This comment has been minimized.

Copy link

@coderhh coderhh commented Nov 15, 2017

I clone a repo from account 1 using account 2, after making some changes, i want to push the changes.
But account 2 was denied by remote account 1. So i config the account 1 as the local setting under working directory and ran the reset-author command. After all this, when i commit. It still use account 2 and was denied.

@nafg

This comment has been minimized.

Copy link

@nafg nafg commented Jul 17, 2020

You can add --no-edit to avoid the editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.