【问题标题】:Unable to create temporary object directory when pushing to Azure VM推送到 Azure VM 时无法创建临时对象目录
【发布时间】:2019-11-18 04:50:51
【问题描述】:

我正在尝试使用 azure 在 linux VM 中创建远程 git 存储库,我想通过 ssh 身份验证从 git bash 推送。但是当我尝试在 Azure 上推送到我的 VM 上创建的存储库时,我最终遇到了这个问题。所以这是我到目前为止所做的: 在我的 VM Azure 上:

$ sudo adduser git
$ sudo su - git
$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ touch .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
$ cd /var/git
$ mkdir myproject.git
$ cd myproject.git
$ git --bare init

在我的本地机器上,我创建了 ssh 密钥并将其复制到虚拟机中使用

cat ~/.ssh/id_rsa.pub | ssh USER@IP "cat >> ~/.ssh/authorized_keys"

但是当我们尝试推送它时,我们得到了这个错误:

$ cd myproject_development
$ git init
$ git add .
$ git commit -m ’commentaire : ma premiere validation’
$ git remote add origin git@dns_aws_git_server:/var/git/myproject.git
$ git push origin master

【问题讨论】:

  • 错误本身往往表明存在权限问题,但任何使 Azure VM 的 git 命令无法执行操作系统级别的 mkdir 操作的事情都会导致此问题。设置看起来正确,所以我不确定为什么您的 Azure-VM git 无法创建新的临时目录,但这就是要调查的内容。

标签: git azure ssh


【解决方案1】:

我最终找到了问题所在,我的 repos 没有 git 用户的权限,所以我更改了 push cmd 工作正常:

chown -R git:git myproject.git

【讨论】:

    猜你喜欢
    • 2023-01-19
    • 2021-02-04
    • 2017-10-06
    • 1970-01-01
    • 2017-01-24
    • 2021-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多