使用 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/