小编bil*_*gic的帖子

Git“致命:在存储库中检测到可疑的所有权”

Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Run Code Online (Sandbox Code Playgroud)

我试图在用户下执行一些 git 命令www-data,但它不起作用。

为了排除故障,我尝试运行sudo -u www-data git show但它返回fatal: detected dubious ownership in repository

如果我运行sudo -u www-data git diff --shortstat它会返回warning: Not a git repository. Use --no-index to compare two paths outside a working tree

我也尝试添加到sudoers

www-data ALL=(ALL) NOPASSWD: /usr/bin/git show

# and also

www-data ALL=(ALL) NOPASSWD: /usr/bin/git
Run Code Online (Sandbox Code Playgroud)

仍然遇到同样的错误。有什么想法吗?谢谢。

cron git

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

cron ×1

git ×1