I've created an app using a GitHub 'Deploy to Heroku' button. Since the git project has changed, how to update my existing instance with new upstream commits?
Heroku's web console can also do this easily. Connect your app to the GitHub repo to deploy automatically or manually from the selected git branch. Automatic deploys can also wait till CI passes. Use the following steps to configure your project.
Setup
Deploy
in your app's configuration pageDeployment method
, click GitHub
App connected to GitHub
, select and connect your repoAutomatic deploys
Deploy
> Automatic deploys
in your app's configuration pageWait for CI to pass before deploy
Enable Automatic Deploys
Manual deploys
Deploy
> Manual deploys
in your app's configuration pageDeploy Branch
Screenshot
Here's a screenshot to show the UI:
Note: as mentioned by Tim Malone, this only works with your own repos, but this can be addressed by creating a fork as mentioned by Skyost.
I went and grabbed the original repo and then force pushed it onto my app in Heroku. Looks like this:
git clone https://github.com/USER/REPO.git
git checkout v0.7.3
git remote add heroku https://git.heroku.com/APP-NAME.git
git push -f heroku master
Heroku makes it easy to clone the repo for you app using
heroku git:clone -a app-name
I originally tried doing that and then adding the original repo as a remote and merging changes, but I ran into some trouble which I didn't feel like figuring out.
Here's a way to do it if you already have the app cloned or if you want to clone from Heroku first.
# Clone app if you haven't already
heroku git:clone -a appname
# Get latest app
git remote add REPO https://github.com/USER/REPO.git
git branch -b REPO REPO/master
# Delete master
git branch -D master
# Remake it with latest
git checkout -b master
# And force push it to heroku
git push -f heroku master
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