bash 如何通过bash读取Heroku中的单个文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23000054/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 10:10:24  来源:igfitidea点击:

How to read a single file in Heroku via bash

gitbashheroku

提问by MikaAK

I'm trying to read a file in Heroku because it's an old website where Git got corrupted and I no longer have the files for it. I have rolled back to its version to to read from it and I've gotten to the bash folder where it is using

我试图在 Heroku 中读取一个文件,因为它是一个旧网站,Git 损坏了,我不再拥有它的文件。我已经回滚到它的版本来读取它,并且我已经到了它正在使用的 bash 文件夹

heroku run bash
ls app/views/

How can I read my file from here?

我如何从这里读取我的文件?

采纳答案by jordelver

The easiest way would be to clone the repo from Heroku and get the files from Git locally.

最简单的方法是从 Heroku 克隆 repo 并从本地 Git 获取文件。

git clone [email protected]:<your app>.git

git co <revision>

You should then be able to access your files.

然后您应该能够访问您的文件。

回答by Luc Boissaye

When you are using bash you can just cat the file

当您使用 bash 时,您只需 cat 文件

heroku run bash -a my-app

heroku run bash -a my-app

and then :

进而 :

ls app/views/ cat my_super_file

ls app/views/ cat my_super_file