git提交和用户身份

Ger*_*llo 7 git

我正在遵循GIT的官方指南,实际上我在2.2.6段"承诺你的改变"以前,在第1.5.1节"身份"时被要求输入一个像

git config --global user.name "John Doe"
Run Code Online (Sandbox Code Playgroud)

我错过了--global选项,因为我不需要它.现在每次我做git提交,我都会获得

$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.
Run Code Online (Sandbox Code Playgroud)

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

Dan*_*ain 13

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

git config user.email "you@example.com"
git config user.name "Your Name"
Run Code Online (Sandbox Code Playgroud)

  • 如果使用共享(云)构建机器,我们不想为存储库全局或本地设置身份,那么如何仅为单个提交命令指定它? (2认同)

小智 6

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

GitHub 账户名

git 用户名