Git-User-Switch icon indicating copy to clipboard operation
Git-User-Switch copied to clipboard

`git-user` command does not work reliably

Open zxt-tzx opened this issue 3 years ago • 3 comments

In the example below, the setting does not work at all

image

I have also experienced a weird edge case where git-user only sets user.name, but user.email remains unchanged.

zxt-tzx avatar Apr 19 '22 06:04 zxt-tzx

This problem maybe come with if your local or global git user info is inComplete

First, you can check your local git user info in git project directory with git config --list

The first user.name or user.email to appear is git config global user info Then the second user.name or user.email to appear is git config local user info

You can reset git user info with below command

  • gloabl: git config --global --unset user.name, git config --global --unset user.email
  • local: git config --unset user.name, git config --unset user.email

After that, try git-user again, then you set the git config in right way

eJayYoung avatar Apr 27 '22 05:04 eJayYoung

Weird, but I noticed this issue as well. For my particular use case, I don't care if I have to use this command twice, but there is something wrong definitely.

geongeorge avatar Oct 04 '22 04:10 geongeorge

@eJayYoung You're right! This was because I did not have a global user setup. You can use git-user for that as well. Just run: git user --global and setup the global user.

geongeorge avatar Oct 04 '22 07:10 geongeorge