git 提交和用户身份

标签 git

我正在关注 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 选项,是否存在其他方式?

最佳答案

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

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

关于git 提交和用户身份,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15392575/

相关文章:

来自 IDEA 的 github 提交未显示在贡献事件中

windows - sh 脚本不会将 ssh key 添加到 ssh-agent (windows git bash)

git - 如何通过ubuntu更新github中的文件

git - 如何从git中删除已删除的文件?

git - 从多个存储库获取一段时间的提交历史

linux - 如何在没有管理员权限的 Linux 上安装 Git(本地)

python - 如何使用 pipenv 安装特定的 git 分支

Ruby 创建数组形式的 git 日志?

git - 如何知道我是否正在使用 Mercurial 进行 histedit?

linux - 在 GitHub 之前,开发者是如何共享 git repos 的?