错误:无法打开.git / FETCH_HEAD:参数无效

时间:2015-06-03 02:06:54

标签: windows git

我正在使用Git(来自GitHub for Windows发行版)并尝试从我的回购中提取并出现以下错误:

D:\Code\dopey-weaver [master]> git fetch
error: cannot open .git/FETCH_HEAD: Invalid argument

D:\Code\dopey-weaver [master]> git fetch --verbose
error: cannot open .git/FETCH_HEAD: Invalid argument

这不是"权限被拒绝"还有许多其他问题,所以看起来我是一个特殊的雪花...我可以打开.git/FETCH_HEAD它看起来很好(?):

010779f14f5bdf1d2d806a0ce0ac4c5e50314186        branch 'master' of https://github.com/nicktimko/dopey-weaver

我认为我与遥控器上的内容存在一些冲突所以我应该拉/合并,但我甚至无法启动...推送时的错误消息确实看起来有点长(这相当于hg说"这会产生多个脑袋"用不多的词?)

D:\Code\dopey-weaver [master]> git push
To https://github.com/nicktimko/dopey-weaver.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/nicktimko/dopey-weaver.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

1 个答案:

答案 0 :(得分:1)

问题似乎是因为卷(exFAT驱动器)很脏,因此是只读的,需要通过chkdsk运行。所以,要解决:

  1. 以提升模式启动PowerShell / CMD(简单方法是右键单击“开始”菜单中的快捷方式,然后选择“以管理员身份运行”)
  2. 在所需的卷上运行chkdsk,例如chkdsk D: /X/X迫使下马)
    • 如果您在主分区(C:)上遇到此问题,那么您可能必须在启动时chkdsk以某种方式执行此操作。