git:致命:发现未知的存储库扩展名:Worktreeconfig

发布于 2025-02-11 01:08:11 字数 993 浏览 1 评论 0原文

据我所知,我从Darwin主机到Linux主机(Ubuntu 18.04)的GIT存储库副本,

据我所知,我没有在此存储库中使用Worktree,但我可能错了。

但是,当在目标库上键入“ git状态”时“在目标”(因此Linux主机)时,我会收到以下错误:

kalou@majapatoche:~/xmp$ git status
fatal: unknown repository extensions found:
        worktreeconfig

,我尝试转动Git Config中的任何相关选项...

kalou@majapatoche:~/xmp$
m1:xmp kalou$ git config --list | grep orktre
extensions.worktreeconfig=true

m1:xmp kalou$ git config  extensions.worktreeconfig=false
error: invalid key: extensions.worktreeconfig=false

因此 更多,我删除了与“ worktree”相关的.git目录中的任何文件...也没有成功。

kalou@majapatoche:~/xmp$ find . | grep worktree
./.git/config.worktree
kalou@majapatoche:~/xmp$ rm .git/config.worktree
kalou@majapatoche:~/xmp$ git status
fatal: unknown repository extensions found:
        worktreeconfig

我在Ubuntu 18.04主机上使用以下GIT版本:有关

kalou@majapatoche:~/xmp$ git --version
git version 2.17.1

如何解决此问题的任何提示?

I did a copy of a git repository from a Darwin host to a Linux host (ubuntu 18.04)

As far as I remember, I did not use worktree in this repository, but I might be wrong.

However, when typing "git status" on the repository "at target" (so Linux host), I get the following error:

kalou@majapatoche:~/xmp$ git status
fatal: unknown repository extensions found:
        worktreeconfig

So I tried to turn of any worktree related option in git config ... which fails

kalou@majapatoche:~/xmp$
m1:xmp kalou$ git config --list | grep orktre
extensions.worktreeconfig=true

m1:xmp kalou$ git config  extensions.worktreeconfig=false
error: invalid key: extensions.worktreeconfig=false

Trying to dig a little bit more, I remove any file within the .git directory related to "worktree" ... no success either ;

kalou@majapatoche:~/xmp$ find . | grep worktree
./.git/config.worktree
kalou@majapatoche:~/xmp$ rm .git/config.worktree
kalou@majapatoche:~/xmp$ git status
fatal: unknown repository extensions found:
        worktreeconfig

I'm using the following git version on Ubuntu 18.04 host:

kalou@majapatoche:~/xmp$ git --version
git version 2.17.1

Any hint on how to solve this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

Oo萌小芽oO 2025-02-18 01:08:11

extensions.worktreeconfig设置(如果存在),并设置为true,请告诉GIT版本2.20及以后添加了工作树(来自Git> Git Worktree add add)可能正在使用某些每隔工作环境。

由于您的git是2.17版,因此不支持这一点。您可以使用:

git config --unset-all extensions.worktreeconfig

要删除设置, 1 ,但是任何工作环境设置都会丢失,而不是由于被忽略而不是很大的损失。但是,使用GIT版本2.17,这种设置绝不应获得 set 。归档.git存储库,然后将其移至具有较旧的git版本的计算机(或通过某些网络文件系统共享.git存储库目录)可能会导致此问题;这就是您应该使用git克隆而不是简单地包装和移动.git目录的原因之一。

另外,您可以将GIT版本升级到2.20或更高版本。 2.17在这一点上很旧。


1 将其设置为false需要:(

git config extensions.worktreeconfig false

在此处使用=字符),但由于扩展。*设置是特殊的。

The extensions.worktreeconfig setting, if present and set to true, tells Git versions 2.20 and later that added working trees (from git worktree add) may have some per-worktree setting(s) in use.

Since your Git is version 2.17, it does not support this. You can use:

git config --unset-all extensions.worktreeconfig

to remove the setting,1 but any per-worktree settings will be lost—not precisely a large loss since they were being ignored. This setting should never have gotten set though, with Git version 2.17. Archiving the .git repository and moving it to a machine with an older Git version (or sharing the .git repository directory via some networked file system) can result in this problem; that's one reason you're supposed to use git clone rather than simply packing up and moving the .git directory.

Alternatively, you could upgrade your Git version to 2.20 or later. 2.17 is pretty old and stale at this point.


1Setting it to false requires:

git config extensions.worktreeconfig false

(no = character here), but may not work since extensions.* settings are special.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文