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

后端 未结 9 1015
慢半拍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:26

    My situation was that I ran git checkout 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 :-)

提交回复
热议问题