git:致命:发现未知的存储库扩展名:Worktreeconfig
据我所知,我从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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
extensions.worktreeconfig
设置(如果存在),并设置为true
,请告诉GIT版本2.20及以后添加了工作树(来自Git> Git Worktree add add
)可能正在使用某些每隔工作环境。由于您的git是2.17版,因此不支持这一点。您可以使用:
要删除设置, 1 ,但是任何工作环境设置都会丢失,而不是由于被忽略而不是很大的损失。但是,使用GIT版本2.17,这种设置绝不应获得 set 。归档
.git
存储库,然后将其移至具有较旧的git版本的计算机(或通过某些网络文件系统共享.git
存储库目录)可能会导致此问题;这就是您应该使用git克隆
而不是简单地包装和移动.git
目录的原因之一。另外,您可以将GIT版本升级到2.20或更高版本。 2.17在这一点上很旧。
1 将其设置为false需要:(
在此处使用
=
字符),但由于扩展。*
设置是特殊的。The
extensions.worktreeconfig
setting, if present and set totrue
, tells Git versions 2.20 and later that added working trees (fromgit 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:
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 usegit 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:
(no
=
character here), but may not work sinceextensions.*
settings are special.