如何找到与heroku应用程序关联的github存储库?

时间:2019-06-20 14:20:51

标签: heroku

我有一个带有异常路由的heroku应用程序,因此转到根URL会导致应用程序错误,因为从该URL没有映射任何内容。但是,我知道该应用程序上的其他路线可能很重要。

我想删除该应用程序,但是直到我看到它的真实含义后才能删除它。目前,我不得不尝试尝试使用www.myapp.herokuapp.com/userswww.myapp.herokuapp.com/itemswww.myapp.herokuapp.com/locations等等url进行猜测。

如果我可以看到从中构建应用程序的代码库,那么就可以解决我的问题

2 个答案:

答案 0 :(得分:1)

我刚尝试heroku slugs:download -a myapp并获得

Warning: slugs:download is not a heroku command.

您需要先安装heroku/heroku-slugs插件,才能识别该命令。

heroku plugins:install heroku-slugs

但是请像您一样先尝试

heroku git:clone -a APP-NAME

然后是git log -1:这将为您提供最新提交的SHA1。

然后您可以在GitHub上执行Commit search by hash
示例:

https://github.com/github/gitignore/search?q=hash%3A124a9a0ee1d8f1e15e833aff432fbb3b02632105&type=Commits


OP stevec提到in the comments使用“ How to clone all repos at once from GitHub?”来处理100多个存储库,并且(严格地)也下载了私有存储库(不仅仅是公共存储库)。
也就是说:编写一个bash脚本来克隆我帐户中的每个存储库,并以某种方式搜索特定的SHA。

我建议在“ How to check if the commit exists in a Git repository by its SHA-1”之后加上一个简单的git log -1 SHA

git rev-parse -q --verify "$sha^{commit}" > /dev/null

OP添加:

我意识到您的初始解决方案肯定有效(即使是私人仓库)。

heroku git:clone -a APP-NAME
git log -1, 
https://github.com/search?q=hash%3A<SHA>

答案 1 :(得分:0)

有关下载代码的信息,请参见documentation。 Heroku允许您从其服务器克隆git repo-只要您可以访问Heroku中的应用程序,就可以查看已部署的确切代码。