How to amend default user name and email before committing code to remote github repository

If you commit the code to a local github repo with the default user name, you will get the message as shown below:
$ git commit MumbaiStock.pm -m v1.5 <enter>
[master 24fea3] v1.5
 Committer: wronguser <wrongemail@wrongdomain.com>
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. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config –global –edit

After doing this, you may fix the identity used for this commit with:

    git commit –amend –reset-author

 1 file changed, 9 insertions(+), 2 deletions(-)

$ git config --global --edit <enter>
Now enter the right user name and email ID

$ git commit --amend --reset-author <enter>
Will correct the user name and email ID.

Leave a Reply

  

  

  

Blue Captcha Image
Refresh

*

June 2019
M T W T F S S
« Feb    
 12
3456789
10111213141516
17181920212223
24252627282930