How to configure git to include my name in commits

I set my name and email address as follows

git config --global user.name myname

However, when I run git log after the commit, it shows the unknown instead of myname:

Author: unknown <myname@mybox.mycompany.com>

What should I do to make my name appear on the journal team?

Edit: The output of config -l is as follows:

core.symlinks=false
core.autocrlf=false
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
gui.recentrepo=C:/Git/MyProject
core.editor='C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin
core.autocrlf=false
user.name=myalias
user.email=myalias@MYDOMAIN.com
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@git:myproject.git
branch.master.remote=origin
branch.master.merge=refs/heads/master

Edit: The bounty has begun.

Edit 2: in fact, git commit from the command line included my name, but TortoiseGit was unable to do this. So this is a problem with TortoiseGit.

+5
source share
5 answers

Create an empty directory without a parent being git-repository and cd. Run the following commands.

git init .
touch foo
git add foo
git commit -m "initial"
git log
git config -l

, git log git config -l .

+5

git config --global user.name myname , .

.gitconfig user.name

?

+4

( "" ) .git/config? .

+3

, () GIT_AUTHOR_NAME GIT_COMMITTER_NAME, .git/config

, , , , , . ( , ..)

+3

Here's how you can change your story . You should probably also check your .mailmap file to see if there are any conflicting settings there.

+3
source

All Articles