Heroku site 是对的,local 是错的。如何在本地克隆我的 heroku 代码?

Heroku site is right, local is wrong. How can clone my heroku code locally?

我只使用 css 和 javascript 创建了一个静态站点。一切似乎都在 Heroku 上运行,使用与本地相同的代码,但由于某种原因,当我在本地运行该站点时,css 有很多问题。以前有没有人遇到过这个问题并且可以提供一些见解?或者有没有办法将代码从 heroku 克隆回我的本地存储库?任何帮助将不胜感激!谢谢。

您可以将现有的 heroku 应用克隆到本地机器 heroku git:clone -a myapp to heroku docs

heroku git:clone -a myapp

To clone the source of an existing application from Heroku using Git, use the heroku git:clone command: Replace myapp with the name of your app.

This will create a new directory named after your app with its source and complete repository history, as well as adding a heroku git remote to facilitate further updates.

但如评论中所述,问题可能主要是因为 css 文件路径,因此如果这不能解决问题,请确保使用正确链接所有 css 文件浏览器开发者工具 .