“错误的配置行1"克隆时在配置文件中 [英] "bad config line 1" in config file when cloning

查看:76
本文介绍了“错误的配置行1"克隆时在配置文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Bitbucket托管的存储库克隆到计算机时出现错误.

I'm getting an error when cloning a bitbucket-hosted repository to my computer.

当我输入git bash时:

When I enter in git bash:

git clone https://myusername@bitbucket.org/groupname/repositoryname.git

我收到消息

克隆到存储库名称".

Cloning into 'repositoryname'..

致命:文件U://.../repositoryname/.git/config中错误的配置行1

fatal: bad config line 1 in file U://.../repositoryname/.git/config

文件'repositoryname/.git/config'的取消链接失败.
我应该再试一次吗?(是/否)

Unlink of file 'repositoryname/.git/config' failed.
Should I try again? (y/n)

目标文件夹包含一个 .git 子文件夹,该子文件夹本身包含文件 config ,以及一个包含各种文件的 hooks 子文件夹.
配置文件具有以下内容:

The destination folder contains a .git subfolder, which itself contains the file config, along with a hooks subfolder containing various files.
The config file has the following contents:

[core]
repositoryformatversion = 0
filemode = false

通过按 y 再次尝试无济于事.

Trying again by hitting y accomplishes nothing.

我知道之前曾问过类似的问题:错误的git配置文件.git/config ,但这与正在使用的存储库有关.
这甚至是入门上的问题,所以我茫然不知所措.

I am aware of a similar question asked earlier: Bad git config file .git/config, but that had to do with a repository that was being worked on.
This is a problem with even getting started, so I'm at a loss to see what to do.

如果我的 .gitconfig 文件被认为是错误的可能来源,请在此找到其内容:

In case my .gitconfig file is considered as a possible source of the error, here its contents:

[user]
name = ...
email = ...

推荐答案

请检查您是否正在克隆网络驱动器,因此它可能无法正常工作.

Please check if you are cloning on a network drive, it is probably not working because of that.

如果可以,请直接切换到本地计算机.

If you can, please just switch to local machine.

如果您确实需要在网络驱动器上进行克隆,请使用

If you really need to clone on a network drive please check if the problem is caused by hardlinks by using the --no-hardlinks option:

git clone --no-hardlinks /path/to/your/repository

NB:通常,如果在网络驱动器上设置了 HOMEDRIVE / HOMESHARE 环境变量并首次克隆,就会发生这种情况.

NB: usually this happens if your HOMEDRIVE / HOMESHARE environmental variables are set on a network drive and you clone for the first time.

这篇关于“错误的配置行1"克隆时在配置文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆