Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
729 views
in Technique[技术] by (71.8m points)

github - Git author Unknown

my author name in all my commits is coming up as unknown https://github.com/freeenergy/Teacher-Login-Validation-Module

did this

$ git config --global user.name "Firstname Lastname"Sets the name of the user for all git instances on the system
$ git config --global user.email "[email protected]"

but still the author/committer name shows [unknown]

not knowing what I was doing I experimented with setting $ GIT_AUTHOR_NAME="my name" and it changed my name to my username [freeenergy] (I.E. my issue was fixed.) But when I switched back to my other computer the issue was the same.

my config file now looks like this but is still committing as [unknown]

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = [email protected]:freeenergy/my-project.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[user]
    name = my name
    email = myEmail.com
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Even better than running git config, you can edit your ~/.gitconfig file directly. Look and see if there's a section for [user] with the relevant information. For example, my ~/.gitconfig has this...

[user]
    name = Bob Gilmore
    email = [email protected]

(There's no space in front of the [user], and single tabs in front of the name and email labels)

If it doesn't have those set properly, just go ahead and edit the .gitconfig file by hand.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...