使用SourceTree出现错误git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks branch

问题:

使用SourceTree出现以下错误:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks branch -D dev
error: Cannot delete branch 'dev' checked out at 'xxx'
完成时带有错误,见上文。

在这里插入图片描述

原因分析:

我想删除本地的一个分支’dev’,结果因为没有切换到其他分支上就进行强制删除,而导致出现这个错误。

解决方法:

先切换到其他分支,将你想删除的分支删除即可。注:如果你想将本地的分支在远端也创建,把你本地的分支推送到远端即可

使用SourceTree出现错误git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks branch_第1张图片

你可能感兴趣的:(git,github)