Why powershell and cmd.exe use the git config file is in C:\c\Users\xxx\.gitconfig?

I have installed git on my windows pc, when I run git config --global using powershell or cmd.exe, it’s writing to this file C:\c\Users\xxx\.gitconfig.

While when I run the git config command in git-bash, it’s operating this file:
C:\Users\xxx\.gitconfig

  • Styling a C/C++ file on diffs
  • Files not updating with custom work-tree in Git
  • git push to the forked prj; pull request to a parent branch
  • How to add new folder to git branch without adding it to master
  • How to pack all loose objects in Git?
  • SSH config with multiple keys for multiple gitlab user accounts
  • Where the c\ folder coming from?? I don’t get it.

    How can I tell powershell and cmd.exe use the same file as git-bash??

  • How do you get git to always pull from a specific branch?
  • 2 git repositories in one directory
  • How can I move commits from the trunk to a branch in Git?
  • Missing some variable declaration in java file when git Merge with another branch
  • In rebase conflicts, how to say “use file from branch A, blow away file from master”?
  • Cloned directly from repo…get error when pushing
  • One Solution collect form web for “Why powershell and cmd.exe use the git config file is in C:\c\Users\xxx\.gitconfig?”

    I find the cause of the issue: I installed cygwin before, and it sets the HOME environment variable on my pc to c\Users\xxxx, that’s why powershell and cmd.exe is locating the file in that folder.

    Git Baby is a git and github fan, let's start git clone.