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 run bash
ls app/views/
How can I read my file from here?
The dashboard can be accessed via the CLI: $ heroku addons:open filepicker Opening filepicker for sharp-mountain-4005… or by visiting the Heroku Dashboard and selecting the application in question. Select Ink file picker from the Add-ons menu.
If you've been using git push heroku main to deploy your code, you can pull it down using the heroku git:clone command displayed in the Deploy section of the dashboard for your app. After pulling down your code, you can follow the instructions to push to your destination of choice.
Just go to https://dashboard.heroku.com/apps/YOUR_APP_NAME/deploy/heroku-git. If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key. Use Git to clone YOUR_APP_NAME's source code to your local machine.
To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.
When you are using bash you can just cat the file
heroku run bash -a my-app
and then :
ls app/views/
cat my_super_file
The easiest way would be to clone the repo from Heroku and get the files from Git locally.
git clone [email protected]:<your app>.git
git co <revision>
You should then be able to access your files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With