sourcetree错误:this operation must be run in a work tree

原因:代码目录被重命名了。

打开代码目录下 .git/config 文件。找到 worktree = D:/xxxxx   把这里的目录地址修改正确。