这里是普通文章模块栏目内容页
git项目,执行命令this operation must be run in a work tree

git项目,执行命令this operation must be run in a work tree

输入git部分常用命令会出现this operation must be run in a work tree,但是当前项目本身就是git项目,项目根目录下也有.git目录。


git status
fatal: this operation must be run in a work tree

原因是你clone项目的时候,会在.git目录中的config文件(可以使用文本编辑器打开)中的core.worktree节点配置是记录工作树的根。所幸我们可以修改。

解决命令:执行 git config core.worktree "路径"命令就可以了。


栏目索引
相关内容