Linking my Heroku app to GitHub - heroku

I have an app on Heroku and I want to link it to github. I've tried some suggestions found on here. For example
git remote add heroku git#heroku.com:<app name>.git
but I get
fatal: remote heroku already exists.
What do I need to do?

Heroku waits for a new push from Github before deploying. You have to first push to Github, and then connect your repository to Heroku.

Related

Deploy to Heroku from parse server example successfully but repo size 0

I have deployed the Parse-Server-Example to the Heroku directly through the github and it is successfully deployed, but my Heroku App dashboard shows that the repo size is 0.
Could you help me?
Thanks
Your Heroku repo size will be zero because you are linking parse-server through github and it's not stored on Heroku. What you can do to change this is clone your repo by installing Heroku command line tools and this command.
heroku git:clone -a project-name
Make whatever changes you like and push back to heroku by using
git push heroku master
After pushing your project to Heroku it should tell you the size of your repo.

Don't have access to Heroku app

I have a mystery app in Heroku. It's called weird-app-5536
When I try to push my code to Heroku I get this message:
Your account my_email#geemail.com does not have access to weird-app-5536.
!
! SSH Key Fingerprint: *************************************************
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
When I try...
heroku apps
I get a list of my apps, but it does not include the mystery app, weird-app-5536.
I can't destroy or rename the weird-app-5536 app. It always says I don't have access.
The app does not appear on my list of apps on the Heroku website.
When I type
git remote -v
I get this:
heroku git#heroku.com:weird-app-5536.git (fetch)
heroku git#heroku.com:weird-app-5536.git (push)
origin git#github.com:thisisme/my_code.git (fetch)
origin git#github.com:thisisme/my_code.git (push)
I deleted my old ssh keys. I created a new one and added it to Heroku
I can create new apps and they show up on my list of apps.
As far as I know I only have one Heroku account.
Stumped. I don't know where to go from here.
What's happened is the git repo on which you're working is tied to an old remote. No need to contact heroku or anything... Just remove the heroku git remote and readd it.
Remove by running:
git remote rm heroku
Readd with:
heroku git:remote -a appname
More here: https://devcenter.heroku.com/articles/git
Honestly, I would try to get a hold of Heroku support. It might be possible that you were listed as a contributor to another app by someone but weren't given write access? Heroku support is probably your best bet.

Deploy to heroku directly from my github repository

How can I deploy my app to Heroku directly from my GitHub remote repository?
Does a command for that exist, like this?
heroku push https://github.com/user/repository.git
Any tips? Tricks?
You can put services in between Github and Heroku which may achieve a similar result to what you want.
There are presently two addons in the Heroku Addon library which would be able to do this for you via Continuous Deployment.
Codeship.io (https://addons.heroku.com/codeship)
wercker (https://addons.heroku.com/wercker)
Basically, when you add and setup these addons they install a webhook into your projects github repo and then when you push to the repo, the webhook is triggered which triggers the service to grab your code (run tests if you want) and then push the code to Heroku.
Heroku recently added option to synchronize deployment with GitHub
There is no way to push from one git remote to another. You will have to clone from github and then push to heroku.
snap-ci is an easy way to setup a deployment pipeline from Github to Heroku
git clone git://github.com/heroku/ruby-sample.git
cd ruby-sample
heroku create
git push heroku master
heroku open
It was as default example from heroku. You can get an idea. right ?
Create a 'Deploy to Heroku' button and include in the README - https://devcenter.heroku.com/articles/heroku-button

git with app in heroku and github

With an app in heroku, with git url like git#heroku.com:app.git,
And a repo in github https://github.com/username/other_app.git
Is possible sync the two repos for hosting the sema app in two git servers (heroku and github) ?
And also Link Heroku app to Github repo. For what?
Yes of course this is possible, because git is a distributed repository. You can configure multiple remotes, one at GitHub and one at heroku, and just push your changes to both of them.
Example:
Create repository at GitHub
Clone this repository on your machine, now you have setup the remote "origin" to be GitHub
Setup heroku and add the heroku git remote (either by running heroku create or heroku git:remote -a my_heroku_app). Find details in the git documentation of heroku.
here are some useful commands when working with github/heroku:
show github remote:
git remote show origin
show heroku git:
git remote show heroku
push github to heroku:
git push heroku master
if you have a 'staging' branch on github and want to push this to heroku git (master) for a
'staging app':
git push heroku staging:master -v

How to attach my repo to heroku app

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
git#heroku.com: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.
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 git#heroku.com:{heroku-app-name}.git
Then do this:
git push heroku master
heroku open
If you're using the Heroku Toolbelt, the newer syntax is
heroku git:remote -a project
See this for more.
If you're using just Git without installing the Heroku Toolbelt, you can also create a new application.
Login to your account and go to this link
https://dashboard.heroku.com/apps
Look at the plus sign on the top right corner then select
Create new app
Leave the application name blank to let heroku choose one for you.
Let say your heroku app name is new-app-xxxxx, so to test on adding a file in to it you may try the following command:
git clone https://git.heroku.com/<new-app-xxxxx>.git
cd <new-app-xxxxx>
echo "my test file" > test.txt
git add .
git commit . -m "my test on commit"
git push
Put empty (blank) when the Git prompt for username, and your API Key for the password. You can get your API Key by showing it from the link below.
https://dashboard.heroku.com/account
Note: You cannot authenticate with the Heroku HTTP Git endpoint using your Heroku username (email) and password. Use an API key as described here.

Resources