简体   繁体   English

Microsoft 托管的 devops 代理中的 gitconfig 权限被拒绝

[英]Permission denied for gitconfig in Microsoft hosted devops agent

Using git command in pipeline: git config --system --add 'url azure-devops' Authorization:Bearer $token在管道中使用 git 命令:git config --system --add 'url azure-devops' Authorization:Bearer $token

output: /usr/bin/bash --noprofile --norc /home/vsts/work/_temp/f76ec2f0-0843-41ba-8959-8534015c5e43.sh error: could not lock config file /etc/gitconfig: Permission denied ##[error]Bash exited with code '255'. output:/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/f76ec2f0-0843-41ba-8959-8534015c5e43.sh 错误:无法锁定配置文件/etc/gitconfig:权限被拒绝## [错误] Bash 以代码“255”退出。 Finishing: Configure Git token完成:配置 Git 令牌

I tried to set permission as well but it doesnot work.我也尝试设置权限,但它不起作用。 Also its related to etc directory which need root user.它也与需要root用户的etc目录有关。 Any idea or suggestions on this, please?请问对此有什么想法或建议吗?

As you've noted, your command requires root and it's failing because you don't have it.正如您所指出的,您的命令需要 root 并且它失败了,因为您没有它。 That's because you've used the --system flag to git config , which modifies the system configuration file, usually stored in /etc/gitconfig .那是因为你使用了git config--system标志,它修改了系统配置文件,通常存储在/etc/gitconfig中。

It would be better to use --global if you need something for all repositories on a CI system, and that file should be modifiable by your user.如果您需要为 CI 系统上的所有存储库提供一些东西,那么使用--global会更好,并且该文件应该可由您的用户修改。 Alternately, if you have just a single repository already and want to use it, you can use --local (or omit the flag) to set it only locally.或者,如果您已经只有一个存储库并且想要使用它,您可以使用--local (或省略标志)仅在本地设置它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OpenShift gitconfig权限被拒绝 - OpenShift gitconfig Permission denied Gitconfig:权限被拒绝 - Gitconfig: Permission denied 使用 GitKraken 克隆存储库时“无法打开 '/etc/gitconfig' - 权限被拒绝” - “failed to open '/etc/gitconfig' - permission denied” when clone a repo with GitKraken 错误:无法锁定配置文件 /etc/gitconfig:权限被拒绝 - error: could not lock config file /etc/gitconfig: Permission denied capistrano ssh代理转发 - 权限被拒绝(publickey) - capistrano ssh agent forwarding - Permission denied (publickey) 错误:无法锁定配置文件 C:/Program Files/Git/mingw64/etc/gitconfig:权限被拒绝 - error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied 错误:无法锁定配置文件 C:/Program Files/Git/mingw64/etc/.gitconfig: Permission denied - error: could not lock config file C:/Program Files/Git/mingw64/etc/.gitconfig: Permission denied 在Azure Devops托管代理中进行Git部分/稀疏/窄获取和更新 - Git partial/sparse/narrow fetch and update in Azure Devops Hosted Agent 在 Azure Devops 自托管代理服务器上的管道脚本中使用时,应如何配置 git 用户名和 email? - How should git username and email be configured when used in a pipeline script on an Azure Devops self hosted agent server? Git:索引文件打开失败:“git status”的权限被拒绝。 托管在 Bitbucket 上 - Git: index file open failed: Permission denied on “git status”. Hosted on Bitbucket
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM