Wrong author name in git commit

Gerard Ryan galileo at fedoraproject.org
Thu Mar 15 00:12:21 UTC 2012


On Wed 14 Mar 2012 10:53:00 PM GMT, E Deon Lackey wrote:

> Yes, there is a way to change that. You can do...
> $ git config --global user.name "Romain Forlot "
> $ git config --global user.email "rforlot at yahoo.com"
>
> ...to reset your email and username preferences. That will always do
> 'git commit' as "Romain Forlot <rforlot at yahoo.com>."
>
> You can also do....
>
> $ git commit -a -m "message" --author Romain Forlot <rforlot at yahoo.com>
>
> --author overrides whatever the config setting is.
>
> HTH,
> Deon
>
> P.S. Those only apply to new commits; I don't know of a way to edit an
> existing commit.
>
>
> On 3/14/2012 5:36 PM, Romain Forlot wrote:
>> Hi,
>>
>> I do my first commit on user guide doc but I do not have configured
>> git to use a specific name and mail address. So, I see that my git
>> commit using 'git log' showing Claneys Skyne
>> "Author: Claneys Skyne <claneys.skyne at gmail.com
>> <mailto:claneys.skyne at gmail.com>>"
>> instead of:
>> "Author: Romain Forlot <rforlot at yahoo.com <mailto:rforlot at yahoo.com>>"
>>
>> Is it possible to change that ?
>>
>> Thanks.
>> -- 
>> *Romain Forlot*
>>
>> pub 4096R/862907E5 2011-05-26
>> Key fingerprint = 4549 A7CA 17DC D0AA 0FE0 7953 E6A8 A0C8 8629 07E5
>> uid Romain Forlot <rforlot at yahoo.com <mailto:rforlot at yahoo.com>>
>> sub 4096R/153E34C2 2011-05-26
>>
>>
>>
>
>
>
>


Note: I don't know too much about git, but I think this should work. I'd
suggest maybe waiting until someone more experienced verifies what I say
here before trying it!

I think if you do what Deon has suggested, then do the following to go
back to before you made the commit:

$ git reset --soft HEAD~1

Then it should be in the state you left it right before you made the
commit (i.e. with all your changes staged, just not committed). Doing
the same git commit command again now (with your config updated), should
do what you want.

-- 
Gerard Ryan :: galileo at fedoraproject.org :: http://gerard.ryan.lt/blog
PGP Fingerprint: AA11 A666 C98E B6D8 231C 11ED 6EDC 7E4A 62BC 4A15

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.fedoraproject.org/pipermail/docs/attachments/20120315/67d9fd8b/attachment.sig>


More information about the docs mailing list