How to download Heroku slug?

heroku login
heroku cli
heroku tutorial
heroku slug size
heroku download app
downloading code from heroku
heroku dash
heroku logins

I used GitHub to upload to Heroku and somehow by mistakes those commits are deleted from GitHub and my source code. I'm back to my old code and have lost some work.

I tried to restore using How can I download my code from Heroku but because I didn't use Heroku Git instead I used GitHub one and those commits are now deleted I can download it even via Heroku slug plugin. They are giving me old commits.

I knew I should've make a zip file backup before doing something stupid playing with Git. Those were production files and I've no backup. Only files are now deployed to Heroku is working. but Heroku slug plugin is giving me old files with are present as commit on GitHub not deleted one.

How can I download Heroku current slug files?

heroku plugins:install heroku-slugs

Then this

heroku slugs:download -a Your App name

Slug Compiler, slugignore file. Download, build, and install local dependencies as specified in your build file (for example, Gemfile, package.json , requirements. Downloading the application slug. If you have not used git to deploy your application, or using heroku git:clone has only created an empty repository, you can download the slug that was build when you application was last deployed. First, install the heroku-slugs CLI plugin with heroku plugins:install heroku-slugs, then run:

Maybe you want to rollback to that version and them pull it down locally ?

  1. check heroku releases to check the version you wish to rollback to
  2. heroku rollback v10 10 is the older version of your choice
  3. git log --reflog to see view and copy your commit id
  4. git checkout commit id

  5. heroku git:clone -a APP-NAME to download current version

The Heroku CLI, heroku plugins:install heroku-slugs. Then this heroku slugs:download -a Your App name. When you git push to Heroku, your code is received by the slug compiler which transforms your repository into a slug. Scaling an application then downloads and expands the slug to a dyno for execution. Compilation. The slug compiler is invoked by a git pre-receive hook, which follows these steps: Create a fresh checkout of HEAD from the master

None of the answer work. Turns out I was working in wrong branch.

Initially I worked on another branch then I did something, God knows what, I moved to master brach and my commits get deleted from github and I was moved to master branch which didn't have the latest code

So I moved to branch which I was working.

git checkout <another branch>

And there it was, all my latest code.

I moved to master branch.

git checkout master

I stashed the master branch changed.

git stash

I reset the master branch HEAD with my another branch

git reset --hard <another branch>

Then push all files to master branch on github.

git add -A
git commit -m "Recovered Files"
git push origin master --force

How to download Heroku slug?, Heroku Slugs CLI Plugin. This plugin adds commands to the Heroku CLI for downloading slugs. To Install. $ heroku plugins:install heroku-slugs. Commands. heroku-slugs — Downloads app slugs; heroku-kafka — Manage Heroku Kafka; heroku-papertrail — Display, tail, and search for logs with Papertrail; CLI architecture. The Heroku CLI is built with the Open CLI Framework , developed within Heroku / Salesforce. oclif is available as a framework for any developer to build a large or a small CLI.

heroku/heroku-slugs: CLI Plugin to manage downloading of , Currently running heroku slugs:download -a both downloads the slug and also extracts it. It would be great to allow just downloading the slug� This will download the Slug directly from our filestore on S3. Using a proxy $ export HEROKU_HTTP_PROXY_HOST=<your-proxy-host> $ export HEROKU_HTTP_PROXY_PORT=<your-proxy-port> $ heroku slugs:download 00000000-bbbb-cccc-dddd-eeeeeeeeeeee -a appname

Allow downloading a slug without extracting it � Issue #2 � heroku , Heroku CLI Plugin to manage and download slugs. Slugs CLI Plugin. This plugin adds commands to the Heroku CLI for downloading slugs� Then $ heroku slugs:download your_unique_slug_identifier -a your_application_name This will download and create a folder with the name of your application. The created folder will contain a directory called app which contains the generated source code and a slug.tar.gz file, which is the compressed version the source code.

heroku-slugs, Steps to edit the slug and deploy it � $ heroku slugs -a your_application_name � Use the name of the application which has the files you want to edit� What is a slug. Slugs are compressed and pre-packaged copies of your application optimized for distribution to the dyno manager. When you git push to Heroku, your code is received by the slug compiler which transforms your repository into a slug. Scaling an application then downloads and expands the slug to a dyno for execution.

Comments
  • As I already mention in my question this one didn't work because it's giving me repository from github which is old one. new one somehow got deleted from both github and my pc. because I write some nonsense git commands.
  • Did you try also Heroku clone to get current files from the last deploy to Heroku?
  • The heroku slugs:download command downloads the compiled slug that was built when your application was last deployed. It is not a copy of your git repository. If you've managed to accidentally deploy a bad release, it might be that you're downloading this bad slug. You can pass a UUID to the download command to specify an older release. use heroku slugs -a APP_NAME to locate the UUID for the release, and then heroku slugs:download UUID -a APP_NAME