Home > Back-end >  Upload to Heroku from GitHub other ways
Upload to Heroku from GitHub other ways

Time:04-19

As the GitHub linking is no longer working due to security issues, my app is still on GitHub and I want to put it on Heroku how do I do this easily?

CodePudding user response:

As the security notification says, you can still deploy via git push.

Assuming you have a local copy of your repository¹ and you would normally do something like git push origin main to deploy to GitHub:

  1. cd to your project directory

  2. Check your remotes:

    git remote -v
    
  3. Do you see a Heroku remote?

    • If so, make note of its name and go to the next step.

    • Otherwise, add one:

      heroku git:remote -a YOUR_APP_NAME
      
  4. Now, push directly to the Heroku remote. Assuming it is called heroku:

    git push heroku main
    
  5. You'll probably also want to push to GitHub to ensure the code for your latest release is synced.

I believe this is the simplest option if you're migrating from GitHub integration, but the documentation also lists other options:


¹If, for whatever reason, you don't have a local copy of your repository, git clone it from GitHub and then proceed as above.

  • Related