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

前端 未结 14 1827
情书的邮戳
情书的邮戳 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:38

    Thanks @daniel-hilgrath, your answer helped me till an extent, it did solve for that particular session.

    But in my case I was using SourceTree and on Windows 7. I had to wipe out the Environment variables completely, not only for particular session. I did following.

    SETX HOMEPATH ""
    SETX HOMEDRIVE ""
    

    may be this could be useful for someone who is using this on SourceTree.

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

    I just encountered this error.
    Executing set HOMEPATH in the command line gave this output:

    HOMEPATH=\
    

    Simply deleting this environment variable via set HOMEPATH= fixed the problem.

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

    For me, I have seen this error in sourcetree, it was just a matter of disconnecting the drive P in my computer as it was a net drive.

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

    I hit on this and had to set HOMEDRIVE to something sane.

    e.g.

    set HOMEDRIVE=D:
    
    0 讨论(0)
  • 2021-02-05 02:41

    I experienced this error message intermittently.

    The cause was a VPN connection that I used occasionally. It was blocking access to my networked HOMEDRIVE every time I used it; and git could no longer access the config file.

    Clearly not the cause here because you found your solution, but I thought I'd add it here for anyone else searching.

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

    Try running as Administrator. For whatever reason it defaults to a mapped drive.

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