I use Git with two different emails / profiles, resulting in:
git config user.email >> myRepoEmail@address.com
git config --global user.email >> myGenericEmail@address.com
If I use VS Code and open a terminal, my commits use the repo email address; this makes sense because I am effectively using Git (not VSCode). However, if I use the Source Control Git sidebar and type a commit message, Ctrl+Enter
to commit, etc., then it commits using the global email (myGenericEmail@address.com
), even though I am working in a repo which has a different setup.
Is there a way to tell VS Code to use the repo's settings for commits, rather than invoking --global
for commits?
[EDIT in info from comments]
I suppose I should mention I have in my gitconfig the command
[includeIf "gitdir:C:/Users/myname/privateRepoFolder"]
path = ~/gitconfig-private
and in that alternate gitconfig-private, I have
[user]
email = myRepoEmail@address.com