git config --global user.email "some@email.com"抛出 "error: only one config file at a time."

标签 git git-config

使用 git config user.email "some@email.com"global 配置文件中设置用户邮箱。

使用 git config --global user.email "some@email.com"git config --local user.email "some@email.com" (从 repo 协议(protocol)中)抛出:

"error: only one config file at a time."

我的全局.gitconfig:

[color]
  ui = auto
[user]
  name = My Name
  email = my@email.com
[alias]
  co = checkout
  ci = commit
  st = status
  br = branch
  hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
  lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
  type = cat-file -t
  dump = cat-file -p
[push]
  default = simple
[core]
  autocrlf = true

我应该更改什么才能使全局配置和本地/repo 配置具有单独的 user.name/email?

最佳答案

设置环境变量 GIT_CONFIG 时,git config --global 似乎不起作用。

尝试取消设置 GIT_CONFIG,然后列出您的全局配置

unset GIT_CONFIG
git config --global --list

关于git config --global user.email "some@email.com"抛出 "error: only one config file at a time.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22841295/

相关文章:

node.js - 访问 digital ocean 上的node app - 此站点无法访问

git - 如何理解 .git/conf 文件中的远程 "origin"获取设置?

git - "git init"失败,怎么了?

git - .gitconfig 错误

git - 配置本地分支以推送到特定分支

eclipse + Egit : clone project into workspace

ios - Xcode、Git、Jenkins、PhoneGap 1.5.0 构建错误

java - Jgit 错误?即使使用 UsernamePasswordCredentialsProvider 传递了错误的用户名,Git 克隆命令也能正常工作

git - 我可以在 .gitconfig 中为自己指定多个用户吗?

git - 从 bitbucket 存储库推送到共享主机 ftp 服务器