本文介绍了fatal:此操作必须在工作树中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试更改分支时,我收到此错误。
I get this error when I try to change branch.
可能会提供
/path/to/git/repo/.根据命令:
git branch我得到以下输出
* V1.5 V2.0 master当我尝试命令
git checkout V2.0我得到以下输出:
fatal: This operation must be run in a work tree配置文件内容:
cat config [core] repositoryformatversion = 0 filemode = true bare = true [remote "origin"] url = /path/to/git/repo/.git推荐答案
您的存储库是裸的,即它没有连接到它的工作树。你可以克隆它本地为它创建一个工作树,或者你可以使用几个其他选项之一告诉Git工作树在哪里,例如。单个命令的 - work-tree 选项, GIT_WORK_TREE 环境变量或 core.worktree 配置选项。
You repository is bare, i.e. it does not have a working tree attached to it. You can clone it locally to create a working tree for it, or you could use one of several other options to tell Git where the working tree is, e.g. the --work-tree option for single commands, the GIT_WORK_TREE environment variable, or the core.worktree configuration option.
更多推荐
fatal:此操作必须在工作树中运行
发布评论