Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git config --global user.email "[email protected]" throws "error: only one config file at a time."

Tags:

git

git-config

Using git config user.email "[email protected]" sets user email in global config file.

Using git config --global user.email "[email protected]" or git config --local user.email "[email protected]" (from within a repo) throws:

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

My global .gitconfig:

[color]
  ui = auto
[user]
  name = My Name
  email = [email protected]
[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

What should I change to be able to have separate user.name/email for global config and local/repo config?

like image 526
Saran Avatar asked Apr 03 '14 14:04

Saran


1 Answers

git config --global does not seem to work when the environment variable GIT_CONFIG is set.

Try to unset GIT_CONFIG and then list your global config with

unset GIT_CONFIG
git config --global --list
like image 101
dpat Avatar answered Sep 21 '22 23:09

dpat