You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

向Dokku应用执行git push出错:fatal: 'test-app'并非Git仓库

Dokku Git Push 报错:fatal: 'test-app' does not appear to be a git repository

问题场景

已通过以下命令创建并初始化Dokku应用:

dokku apps:create test-app
dokku git:initialize test-app

完成SSH密钥配置后,添加的远程仓库为dokku:test-app(其中dokku对应服务器IP),但执行git push时触发错误:

fatal: 'test-app' does not appear to be a git repository
fatal: Could not read from remote repository.

解决方案

  • 修正远程仓库地址格式:Dokku要求远程地址必须包含dokku@前缀,当前地址缺少该部分导致Git无法识别。执行以下命令重新添加正确的远程:
    git remote remove dokku
    git remote add dokku dokku@<你的服务器IP>:test-app
    
  • 验证应用Git仓库存在性:登录Dokku服务器,检查/home/dokku/test-app/.git目录是否存在。若不存在,重新执行dokku git:initialize test-app确保仓库初始化完成。
  • 确认SSH连接有效性:执行ssh dokku@<服务器IP> apps:list测试能否正常连接服务器并获取应用列表,验证SSH密钥权限是否正常。

内容的提问来源于stack exchange,提问作者Javi Rodriguez

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 22:48:09