如何使用git(git config --global)? [英] How to use git (git config --global)?
问题描述
GIT的实用指南具有以下 Git使用这两者来计算提交ID - 一个SHA-111哈希,它标识每个提交。在第21页。
在第22页,我可以使用以下命令来配置Git知道你是谁。
git config --global smchoYour Name
当我运行它时,我收到以下错误消息。
错误:键不包含节:smcho
$ b b
这有什么问题?我想它与SHA-111哈希有关,但我不知道如何让它与git一起使用。
ADDED
我认为user.name要替换我的名字,而不是段/ 。更改后,它工作正常。
git config --global user.nameYour Name
<不知道smcho是从哪里来的,但是设置你的名字的设置是 user.name
:
git config --global user.nameYour Name
您也可以设置您的电子邮件地址:
git config --global user.emailname@domain.example
我猜他抱怨的原因缺少一个段是要设置的参数的名称可能需要在两个部分: section.parameter_name
(你可以看到 []
如果你看配置文件,例如在 .git / config
)。
(据我所知,这不是特定于OSX的)
The Pragmatic Guide to GIT has the following "Git uses both to calculate the commit ID—a SHA-111 hash—that identifies each commit." in page 21.
And in page 22, I can use the following command to 'Configure Git to know who you are'.
git config --global smcho "Your Name"
When I ran it, I got the following error message.
error: key does not contain a section: smcho
What's wrong with this? I guess it has something to do with SHA-111 hash, but I don't know how to get it to be used with git.
ADDED
I thought user.name is to be replaced my name, not a section/parameter structured name. After changing that it works OK.
git config --global user.name "Your Name"
Not sure where "smcho" comes from, but the setting to set your name is user.name
:
git config --global user.name "Your Name"
You can set your e-mail address too:
git config --global user.email "name@domain.example"
I guess the reason it complains about the lack of a section is that the name of the parameter to set probably needs to be in two parts: section.parameter_name
(You can see the sections names within []
if you look in the configuration file, for example in .git/config
).
(None of this is specific to OSX as far as I'm aware.)
这篇关于如何使用git(git config --global)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!