I use different emails and users in different git repos.
My git global config file has the user section unset. Here it is (notice how nothing comes after [user]
):
[core]
editor = nano
pager = less -x1,5
[push]
default = simple
[merge]
tool = meld
[mergetool "meld"]
path = /usr/bin/meld
[mergetool]
prompt = false
[alias]
adog2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
adog = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
cc = checkout
co = checkout
s = status
cm = checkout
ck = checkout
u = reset HEAD --
last = log -1 HEAD
st = status
ct = checkout
unstage = reset
cok = checkout
[user]
Whenever I clone a new git repo, the git local config username and email always comes set with a user that I use in one of the other repos, despite the global user being unset. This leads me to accidentally making commits with the wrong user.
How to unset default git user on cloned repositories so that whenever I clone a new repo, the username and email always come empty? Is there a template file from where git copies the local git config?