I just switched to OS X and did my first commit. After pushing to Github the commit author was not my Github username but the current user on my laptop. The commit author appears as "non-author". I want the commit author to be my Github username like before. What should I do to fix it? Here is a photo of what I mean: https://i.sstatic.net/LLEph.png
run following commands in terminal
git config --global user.email "Ur GitHub email"
git config --global user.name "Ur github Username"
While Tilak's answer solves your problem, it doesn't tell you why. This answer is mainly for this purpose.
First thing is: GitHub and Git ARE NOT the same thing.
This is a common mistake. Git is the versioning management tool, while GitHub is a service which provides a Git server on the cloud. Others include Bitbucket and GitLab.
Second thing is:
The default user for commits is the one you run git with. So if, for instance, you executed sudo git commit, the user would be root. What you need to do is, as the accepted answer suggests, configure the username you want, which has nothing to do with your GitHub account, it could be any name.
Third thing is:
The non-author issue is due to the fact that GitHub matches the email of the user that created the repository ON THEIR SIDE and the email of the committer, again, configurable by means of the accepted answer's suggestion. But, your Git user.email configuration has nothing to do, again, with GitHub. It's just used to differentiate repository creator's commits from collaborator's commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With