无法将 git clone 到作为 SFTP 驱动器挂载的磁盘

无法将 git clone 到作为 SFTP 驱动器挂载的磁盘

我在 Win7 下尝试git clone复制我的Z:磁盘。Z:使用实用程序通过 SFTP(连接到本地 FreeBSD 服务器)安装磁盘SFTP Net Drive Free

当我尝试git clone访问本地C:磁盘时 - 一切正常,但是当我尝试git clone访问磁盘Z:git 报告错误时:

cd z:
$ git clone [email protected]:rep.git
Cloning into 'rep'...
error: could not commit config file z:/rep/.git/config
error: could not commit config file z:/rep/.git/config
error: could not commit config file z:/rep/.git/config
error: could not commit config file z:/rep/.git/config
error: could not commit config file z:/rep/.git/config
error: could not commit config file z:/rep/.git/config
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我试图从 github 克隆一些公共仓库:

$ cd c:
$ git clone https://github.com/nicolasff/phpredis.git
Cloning into 'phpredis'...
remote: Counting objects: 3703, done.
remote: Compressing objects: 100% (1578/1578), done.
remote: Total 3703 (delta 2286), reused 3512 (delta 2114)
Receiving objects: 100% (3703/3703), 1.43 MiB | 264.00 KiB/s, done.
Resolving deltas: 100% (2286/2286), done.
Checking connectivity... done

但同样的错误Z:

$ cd z:
$ git clone https://github.com/nicolasff/phpredis.git
Cloning into 'phpredis'...
error: could not commit config file z:/phpredis/.git/config
error: could not commit config file z:/phpredis/.git/config
error: could not commit config file z:/phpredis/.git/config
error: could not commit config file z:/phpredis/.git/config
error: could not commit config file z:/phpredis/.git/config
error: could not commit config file z:/phpredis/.git/config
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

有什么想法吗?提前谢谢您!

答案1

我刚刚遇到了这种情况。为了修复它,我删除了 c:.gitconfig,然后当我运行git clone <project>.. 时,它运行正常。

相关内容