以root用户运行delve获取VCS状态错误



我试图在Arch Linux上运行sudo dlv debug,我一直得到以下错误:

error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
exit status 1

当我删除。git文件夹时,sudo dlv debug按预期运行,所以我认为这可能是git的配置问题?!

当通过vscode在远程容器中打开调试代码时,我有一个类似的错误消息。

当我使用git status时,我得到一条消息说git存储库是不安全的,是由别人拥有的。然后是一条解释使用的消息:

git config --global --add safe.directory [your dir here]

这样做,我不再得到VCS冲压警告

对于来自Google的用户,您可能没有访问文件夹的权限。chmod user:user folder并添加-R以在子文件夹中传播。