向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
相关产品推荐
相关产品推荐

