Git warning: unable to access 'P:\/.gitconfig': Invalid argument

前端 未结 14 1824
情书的邮戳
情书的邮戳 2021-02-05 02:07

I am just testing git. I ran the following command:

git config user.email \"test@mail.com\"

I now get this when git status and oth

相关标签:
14条回答
  • 2021-02-05 02:23

    I was facing this issue when loading a solution in Visual Studio 2017 (v15.1) running as an Administrator. And my local git repo was located in C:\Code\

    To work around the problem,

    1. I added an Environment Variable (under User variable) HOME with value C:\
    2. Restarted Visual Studio (again as an admin) - this time Git was able to load successfully loading my branch & source control association correctly.
    0 讨论(0)
  • 2021-02-05 02:29

    If you are using "Git Bash" (MINGW64) on Windows:

    Enter:

    export HOME=/c
    

    To verify:

    echo $HOME
    
    0 讨论(0)
  • 2021-02-05 02:29

    This worked for me on windows 10.

    My source code is in C:\workspace and I added an environment variable **HOME to C:**

    0 讨论(0)
  • 2021-02-05 02:36

    I experienced a similar issue when not connected to my work network via VPN. Deleting the all the HOME% variables did not work. Deleting the network drive it was trying to access did work. Running the following from a command window worked for me:

    net use H: /delete

    As a note, I did delete the HOME% variables, but it did work until the command above was run.

    0 讨论(0)
  • 2021-02-05 02:36

    It works for me to clear the HOME Variable "nearly" to Daniels solution:

    set HOME=
    

    To recheck you have to echo it like this:

    echo %HOME%
    
    0 讨论(0)
  • 2021-02-05 02:37

    For the PowerShell users out there:

    Remove-Item Env:\HOMEPATH
    

    Thank you @Daniel Hilgarth for the answer

    0 讨论(0)
提交回复
热议问题