Git update Play app Heroku - heroku

I created a cedar stack from git console and changed the default app name set by Heroku from the Heroku web app. Now when I push the new updates from git, getting an error -App not found.
How to set it right?

You have to update your local git config by editing the .git/config file and putting the new name.
Your git config should look like this:
[remote "heroku"]
url = git#heroku.com:oldname.git
fetch = +refs/heads/*:refs/remotes/heroku/*
And the new:
[remote "heroku"]
url = git#heroku.com:newname.git
fetch = +refs/heads/*:refs/remotes/heroku/*

Like niko_ekito wrote in his answer, you can edit the .git/config file by hand. But you can also use Heroku's command line client:
$ git remote rm heroku
$ heroku git:remote -a newname
Or you can use git remote set-url:
$ git remote set-url heroku git#heroku.com:newname.git

Related

When I try to push my app to Heroku I get this response:

When I try to push my app to Heroku I get this response:
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
You should:
Install heroku CLI plugin
Sign in using command heroku login
Add heroku as remote repository (gheroku git:remote -a YOUR_PROJECT_NAME)
Than you can push
You can find instructions here https://devcenter.heroku.com/articles/git
The issue was caused due to your project name used by another developer on heroku remote server. However, you need to change your project name and use the new name to create empty git repository on heroku server by following the command below before you push your project.
For instance, assumed you have changed your project name and is called foodproject-v2-app-launch
Note that your project name must not more than 30 characters on heroku server and must not be capitalize including special symbol except - and numbers.
Now, go to your terminal and 'cd in' to your project directory then run the below code.
Code 1: $ git init
Code 2: $ git add .
Code 3: $ git commit -m "Your Initial or Second commit"
Code 4: $ heroku create
Code 5: $ touch Procfile
Now open your Procfile with editor and add the following code and save it.
Code: web: node app.js
Code 6: $ git push heroku master
or
Code 6.1: $ git push heroku main
That should solve the issue mentioned above. Or refer to this article to read more https://devcenter.heroku.com/articles/git

How to redeploy my laravel application to heroku when I deleted the url that heroku gave me

I have deleted that in dashboard due to some errors during deployment with
$ git push heroku master
and now I want to deploy my laravel application once again. But everytime during deployment it keeps on pushing to that old url. And not to the one that heroku gave me during when I type
$ heroku create
What seems to be my problem ?
Remove old remote
git remote rm heroku
and add again with
heroku git:remote -a your-app-name
or
git remote set-url heroku <new-url>

Heroku - git push

Can anyone please explain what's wrong with these?
mhsjaber:~/workspace/newsite (master) $ heroku keys:add
? Which SSH key would you like to upload? /home/ubuntu/.ssh/id_rsa.pub
Uploading /home/ubuntu/.ssh/id_rsa.pub SSH key... done
mhsjaber:~/workspace/newsite (master) $ heroku create
Creating app... done, ⬢ ancient-island-20017
https://ancient-island-20017.herokuapp.com/ | https://git.heroku.com/ancient-island-20017.git
mhsjaber:~/workspace/newsite (master) $ git push heroku
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Everything up-to-date
You have to add something first to push to heroku server. As your repository is already created on heroku thus, you have to add your app on it, in order to do that follow below steps.
(1) heroku login
(2) git init
(3) git add .
(4) git commit -am "comment"
(5) git push heroku master
in your case you were confusing heroku by not adding master in your git push command.

How to check if my repository has been deployed to heroku?

I have several repositories and only one has been deployed to heroku. How do I find out which one? Because I made a change in one repo and tried to push it but got a warning fatal: 'heroku' does not appear to be a git repository. Is there a command?
It looks like you have not created heroku repository yet or you are in wrong directory. Go to the directory where you have your app then create heroku with the help of below commands.
git init
heroku create
after creating heroku you can add and commit heroku with the help of
git add .
git commit -am "any comment"
last step will be to push all your data to heroku server by
git heroku push master
If repository is already created, you can check associated repository by hitting below command
$ git remote -v
You may need to run heroku git:remote command to associate a Git repository with an existing application
for more information on how to deploy app click here

git push heroku master error: Repository not found

I just tried pushing to heroku from github and this happened, anyone know how to fix this?
$ git push heroku master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
Inside your project folder go into .git/config and look at what (if anything) is defined under the heroku remote.
For example, one of my apps has:
[remote "origin"]
url = git#github.com:jefflunt/cortex.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku"]
url = git#heroku.com:cortex-cedar.git
fetch = +refs/heads/*:refs/remotes/heroku-cedar/*
...where origin is the github repo, master is the master branch on github, and heroku is the name and path to the repository on heroku.
It's important that (a) you have an entry for heroku because that's what makes your push work, and (b) that it's pointed at the correct path/repo.
To get the path/repo for your project go into you application settings on heroku and it should be listed.
On a side note, these lists of remotes in your .git/config file are what make the aliases that you use on the command line work at all, and the names they are given are simply found in the config file.
When I encountered this issue I just deleted this line of code from the .git/config file then I tried repushing to heroku(git push heroku master).
[remote "heroku"]
url = https://git.heroku.com/dry-bastion-47289.git
fetch = +refs/heads/*:refs/remotes/heroku/*
For the easy solution remove the existing heroku git repo and recreate it.
git remote rm heroku
and then recreate it
heroku create
and later if you want to rename
heroku rename <name of your app>
Replaced the Heroku generated app name with our app name in the [remote "heroku"] section of the config file
[remote "heroku"]
url = https://git.heroku.com/[your_app_name].git
fetch = +refs/heads/*:refs/remotes/heroku/*

Resources