12

我正在遵循 GIT 的官方指南,实际上我在 2.2.6 段落“提交您的更改”之前,在第 1.5.1 节“身份”当被要求输入类似的命令时

git config --global user.name "John Doe"

我错过了 --global 选项,因为我不需要它。现在每次我执行 git commit 时,我都会获得

$git commit

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

但我不想输入 --global 选项,是否存在另一种方式?

4

2 回答 2

17

如果您只想为该存储库设置它,请运行:

git config user.email "you@example.com"
git config user.name "Your Name"
于 2013-03-13T17:44:26.697 回答
6

只需键入您在 GitHub 帐户中的相同名称,相同的字母和字符。

GitHub 账户名

git 用户名

于 2018-03-23T18:33:43.173 回答