git 克隆后如何恢复头部?试着到处寻找

how to restore head after git clone? tried searching everywhere

以下是 git 克隆的错误消息:

...
Receiving objects: 100% (8122401/8122401), 3.12 GiB | 3.31 MiB/s, done.  
Resolving deltas: 100% (6746605/6746605), done.

error: invalid path 'drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c'

fatal: unable to checkout working tree warning:  
Clone succeeded, but checkout failed.

You can inspect what was checked out with 'git status' and 
retry with 'git restore --source-HEAD :/ "

见于:

如何让克隆继续进行?

如“", Windows cannot handle any file named AUX.

中所述

考虑到您的输出,我怀疑这是这里的问题:

error: invalid path 'drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c'

我会推荐给:

  • 在本地初始化一个空存储库
  • 将远程存储库添加为 origin
  • 将本地存储库设置为稀疏结帐
  • 将“drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c”添加到 .git/info/sparse-checkout
  • git fetch

以“Git clone all but one file or folder, possible?”为例。