How to update Heroku app created with github "Deploy to Heroku"?

I created the application using the "Deploy to Heroku" github button. Since the git project has changed, how do I upgrade my existing instance with new top-level commits?

+6
source share
3 answers

I went and grabbed the original repo, and then forcibly pushed it into my Heroku app. Looks like that:

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 simplifies repo cloning for your application using

 heroku git:clone -a app-name 

I initially tried to do this and then added the original repo as remote and merging the changes, but I ran into some problems that I didnโ€™t like figuring out.

+3
source

Here is a way to do this if you already have the application cloned or if you want to first clone with Heroku.

 # 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 
+1
source

Assuming your local branch is called master , you can try:

 git pull heroku master 

Keep in mind that you may experience merge conflicts if your local branch and the remote computer diverge. It also assumes that you have configured heroku to indicate a suitable place in the repo.

0
source

Source: https://habr.com/ru/post/983030/


All Articles