fatal: unable to access 'H:\/.config/git/config': Invalid argument [Git on Windows 7]

后端 未结 9 991
慢半拍i
慢半拍i 2021-02-03 22:34

I get this error when opening a git repository:

fatal: unable to access \'H:/.config/git/config\': Invalid argument

Where in git is this path being pulled from?<

相关标签:
9条回答
  • 2021-02-03 23:10

    Set HOME var in 'User variable for ' (Control Panel\All Control Panel Items\System\ => Advanced system settings\Advanced\Env variables)

    It resolved my issue.

    0 讨论(0)
  • 2021-02-03 23:12

    Make sure, in a command line window:

    • HOME is indeed not set: type set HOME, which would return its value if any
    • the issue persists with the latest msysgit distribution (1.9.0): unzip that archive anywhere, and call git with its full path:

      c/mydir/PortableGit-1.9.0-preview20140217/bin/git.exe --global -l
      
    0 讨论(0)
  • 2021-02-03 23:19

    net delete is not a must.

    First check HOME setting, then change HOME and HOMEDRIVE to a existing dir.

    c:\git\selenium-automation>set HOME
    HOME=U:\
    HOMEDRIVE=U:
    HOMEPATH=\
    HOMESHARE=\\XX
    

    then change HOME and HOMEDRIVE by

    set HOME=c:\tmp
    set HOMEDRIVE=C:
    

    c:\git\selenium-automation>set HOME

    HOME=c:\tmp
    HOMEDRIVE=c:
    HOMEPATH=\
    HOMESHARE=\\XX
    
    0 讨论(0)
  • 2021-02-03 23:25

    If you'll check your GIT installation path /git/etc/profile you'll see HOME variable set as:
    HOME="$HOMEDRIVE$HOMEPATH"

    For this I created HOME variable in my Environment variables and it started working.

    0 讨论(0)
  • 2021-02-03 23:26

    My situation was that I ran git checkout <branch> and I had fatal: unable to access 'H://.gitconfig': Invalid argument. Then I run set HOME and had no results. The following steps solved the issue

    1. change SSH keys
    2. restart the computer
    3. find .gitconfig (should be in the root of H:// or whatever drive name you have)
    4. open it with Notepad++ (or other editor) and save as is. If it is empty, then save empty one
    5. then git checkout master started working

    If it happned once again, I would start from step 3 :-)

    0 讨论(0)
  • 2021-02-03 23:30

    As some people are saying this seems to be an issue with HomeDrive and HomePath when using network drives.

    For me this was solved by running my git commands as admin.

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