![无法将 git clone 到作为 SFTP 驱动器挂载的磁盘](https://linux22.com/image/619740/%E6%97%A0%E6%B3%95%E5%B0%86%20git%20clone%20%E5%88%B0%E4%BD%9C%E4%B8%BA%20SFTP%20%E9%A9%B1%E5%8A%A8%E5%99%A8%E6%8C%82%E8%BD%BD%E7%9A%84%E7%A3%81%E7%9B%98.png)
我在 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>
.. 时,它运行正常。