4

when i did git log on my git repository it showing Author: = <=> as author details while in earlier commits it showing me the user name and email.

here is the screen shot of git log.

enter image description here

and in my earlier commits it is showing something like this

enter image description here

Atul Agrawal
  • 1,474
  • 5
  • 22
  • 41
  • 3
    Try running `git config --list` on the machine where you did the commit. Are the `user.name` and `user.email` fields set? – ComicSansMS Jul 26 '16 at 09:17
  • alias.st=status alias.co=checkout alias.br=branch alias.cm=commit alias.ds=diff alias.dc=diff user.email=atul.agrawal9911@gmail.com user.name=Atul Agrawal core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.url= remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* branch.master.remote=origin branch.master.merge=refs/heads/master user.name=Atul Agrawal user.email=atul.polestar@paytm.com – Atul Agrawal Jul 26 '16 at 09:18
  • this is what i got when i did git config --list – Atul Agrawal Jul 26 '16 at 09:18
  • Did you commit using command-line or a GUI tool? – Melebius Jul 26 '16 at 09:22
  • The fact that you have `user.name` and `user.email` set twice might be a reason for this. Maybe [this question](http://stackoverflow.com/questions/4310974/more-than-one-value-for-the-key-user-name-git) can help you, – ComicSansMS Jul 26 '16 at 09:22
  • 1
    I have used phabricator and after review i am landing the branch on master – Atul Agrawal Jul 26 '16 at 09:22
  • @ ComicSansMS: this is because i have different user name for global and for local – Atul Agrawal Jul 26 '16 at 09:23

1 Answers1

7

Try running this if nothing else works when you commit:

git commit --author=<author> ...

Also, to set default configuration for a machine (recommended by myself), do the following:

git config --global "user.name" "Nick Bull"
git config --global "user.email" "nick.bull@email.co.uk"

or across the machine you're on (i.e., for all users) do git config --system "<setting>" "<value>".

Note you have duplicate entries in your configuration. Git will apply a "last one wins" approach to these.

Nick Bull
  • 9,518
  • 6
  • 36
  • 58