Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to attach my repo to heroku app

Tags:

heroku

I create a heroku app and then my machine crashed. I have a new machine. How do I attach my existing app to heroku app. When I visit heroku page the url for my app is like this

[email protected]:myapp.git 

I can't do clone this app because I already have myapp from github. So I need to add heroku as remote to my existing github app. Anyone knows the syntax.

like image 796
Nick Vanderbilt Avatar asked Jul 29 '11 19:07

Nick Vanderbilt


People also ask

How do I link a GitHub repo to Heroku?

Open Deploy tab and scroll to the “Deployment method” section. Select GitHub as the method. It will show a “Connect to GitHub” option where we can provide our GitHub repository. If you are doing it for the first time, Heroku will ask permission to access your GitHub account.

How do I push an existing repo to Heroku?

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.

Can I deploy a private repo to Heroku?

Heroku Button is no longer limited to source code hosted in public GitHub repos. It now works with both public and private GitHub repos.


1 Answers

If you've heroku toolbelt:

If you're using the Heroku Toolbelt, the newer syntax is

heroku git:remote -a project

See this for more.

Credits: user101289's solution

Else if you don't have heroku toolbelt:

First do this:

git remote add heroku [email protected]:{heroku-app-name}.git 

Then do this:

git push heroku master heroku open 
like image 137
thenengah Avatar answered Sep 19 '22 10:09

thenengah