fatal: 'git_url' does not appear to be a git repository - ruby-on-rails

When i run
G:\blogx>heroku create
DL is deprecated, please use Fiddle
Creating name... done, stack is stack
web_url | git_url
on running
G:\blogx>git push heroku master
fatal: 'git_url' 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.
on running
G:\blogx>git remote -v
heroku git_url (fetch)
heroku git_url (push)
I am not sure why this error is being generated...

Heroku wants you to deploy from Git, but you haven't got a valid URL to a git repository in your setup. Somehow, you've ended up with something called git_url instead of an actual path to git.
The easiest way to fix this is to run git remote rm heroku to remove the broken one, find your application's name in the Heroku control panel, then run heroku git:remote -a your-app-name-here.
The Heroku guide to deploying from Git and the Heroku getting started guides is a useful reference.

Related

Heroku: Permission denied (publickey). fatal: Could not read from remote repository when doing git push

I've spent the day reviewing all the existing solutions suggested on Stackoverflow and elsewhere, and tried them without success, and I'm still stuck with this.
The "heroku keys:add" solution doesn't work for me, so please don't link me back to that one.
I'm on MacOSX Lion. Thanks
Heroku no longer needs to use the git protocol & Public/Private encryption keys, instead you can use the following command to use your Heroku API key
heroku login
This command creates (or updates) a ~/.netrc file with your Heroku API key.
Now, any Heroku remote repository can be pushed to via the https protocol, rather than the git (ssh) protocol.
Check the address of your Heroku repository for your project with:
git remote -v
If your git remote address for Heroku starts with https://git.heroku.com/... then you are good to push. If the remote address starts with git then you need to update the remote address for Heroku
git remote set-url heroku https://git.heroku.com/...
Check the Heroku dashboard Settings tab for your app for the full Git URL for that app
If you have already git initialized and heroku toolbet is completely installed , enter this command $ git remote -v it will initialize heroku git and you can push to it.
Whenever you run the command $ git remote -v , will create a git repo in app_name/.git/logs//refs/remote/heroku , first check whether your git been initialized for heroku or not, even I had the same problem and I've corrected.

Error pushing to Heroku after adding new domain

I recently added a new GoDaddy domain to my rails app.
Everything works fine when I push to git but when I try to push to Heroku using:
$ git push heroku
I get the following error:
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.
Is this problem occurring because I need to create another environment? The domain name for my GoDaddy website is listed under '$ heroku domains' but doesn't seem to be connected.
Any ideas would be helpful. TIA!
As for your comment on answer below, its obvious that you should try
git push prod master instead of git push heroku
'heroku' and 'prod' it's just names of remote repositories. Heroku by default creates repos named accordingly - 'heroku'. As far as I know it could be changed to whatever you need
This issue is probably unrelated to godaddy. Try typing
git remote -v
this will give you a list of the remote repositories you have setup. If none are pointing to your app on heroku you'll need to set it up.
Refer to this on article from heroku dev center
https://devcenter.heroku.com/articles/git
EDIT
As i suspected your heroku remote is named "prod" not "heroku" try 'git push prod' that should work.
You might have to specify the branch in which case the command would be 'git push prod master'
EDIT2
It looks your are not yet authorized to push to heroku. The root problem can vary. I recommend starting with this article:
https://devcenter.heroku.com/articles/keys
Also check this SO article
git push heroku master Write failed: Connection reset by peer

Cannot git push to heroku master for ruby.railstutorial.org

I am working on the ruby.railstutorial.org and I am having all sorts of trouble getting my first_app to push from git to heroku. I have tried the solutions listed below but keep getting back the same error messages.
Solutions I have tried:
git push heroku master gives error ssh: connect to host heroku.com port 22: Connection refused
git push heroku master gives error ssh: connect to host heroku.com port 22: Connection refused
I have tried precompiling as:
$ rake assets:precompile
$ git add .
$ git commit -m "Add precompiled assets for Heroku"
and getting a new ssh key. I can't seem to get anything to work. Here is what I am getting:
Coreys-MacBook-Pro:first_app coreydavis$ heroku create
Creating radiant-oasis-3729... done, stack is cedar
http://radiant-oasis-3729.herokuapp.com/ | git#heroku.com:radiant-oasis-3729.git
Coreys-MacBook-Pro:first_app coreydavis$ git push heroku master
ssh: connect to host heroku.com port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I know the repository exists and I have access, I can't figure out what I am missing here.
Any help would be great, I am very, very new to this and don't totally understand what is going wrong despite my reading and google searches. Thanks so much.
You need to assign a public key to your Heroku account, as described in their docs.
Also, double-check that the git remote is actually the Heroku app repository that you expect it to be.
$ git remote -v
You should see your Heroku app name in the list that comes out of this command.
Another thing to check is that you are not behind a firewall that is blocking port 22. That would be unusual, but not unheard of. There are also various software that will block access to AWS/EC2; make sure you're not running anything like that since Heroku runs on EC2.
I've had this issue before. If you're public key is missing the error usually indicates it. Make sure that you've logged into your GitHub account and created the new repository there first. Then run the following on the command line:
git init
git commit
git remote add origin https://github.com/username/your_repository_name.git
git push
#you should be prompted to enter your github credentials
#your code will then be pushed to your github repository
git push heroku
#heroku will fetch your your github repository and install to your heroku instance
heroku open
#this will open your heroku instance in a new browser window.
Good luck!!
If you created multiple apps you'll still only have your original as the remote.
git remote -v
shows you what your remotes are named and the url. Usually you'll have it named origin and you can remove it with:
git remote rm origin
Then you need to add the new heroku app name:
git remote add origin <URL to new heroku app>
Finally push your app:
git push -u origin master
The -u tag will mark it as tracked.

Could not read from remote repository when pushing to Heroku (Rails Tutorial 5)

I pushed my chapter 5 version of Sample_App to git, and then when I 'git push heroku' I get:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
! No such app as sample_app.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have read through some of the similar stackoverflow questions, and so I know to look at the 'git remote -v':
heroku git#heroku.com:sample_app.git (fetch)
heroku git#heroku.com:sample_app.git (push)
origin git#github.com:jeffbenner/sample_app.git (fetch)
origin git#github.com:jeffbenner/sample_app.git (push)
I have tried removing heroku and re-pushing - I get the same error message.
I looked at 'git config -l':
user.name=jeffbenner
user.email=xxxxx#gmail.com
alias.co=checkout
push.defaults=simple
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=false
remote.origin.url=git#github.com:jeffbenner/sample_app.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
remote.heroku.url=git#heroku.com:sample_app.git
remote.heroku.fetch=+refs/heads/*:refs/remotes/heroku/*
I cannot figure out why I cannot push to Heroku. I have re-logged into both my Github and Heroku accounts through the CLI. Any direction would be much appreciated.
I just came across the same problem. I did the following:
cd .git
vim config
removed all lines referencing Heroku
cd ..
heroku create
git push heroku master
... And voila, it worked.
Hoped this helps.
Did you try to specify the branch that you are pushing. Try git push heroku master. You can read about the warning in the docs. Let me know if it worked
Edit
I would just start over all together and create a new Heroku address. Follow these steps in order
First in your Gemfile create these groups
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Important, make sure you are in the root of your project and make sure you run bundle install like this
bundle install --without production
now git add . then git commit -m 'your commit message'
now run heroku login from the command line
now run heroku create
then git push heroku master
finally heroku open will open your app in your browser
If all of this doesn't work then move the app into a new directoy and start all over by first git init, git add . and git commit -m 'first commit in new location' and follow the steps above starting with heroku login
Note that heroku and github both use git but are independent entities. If you can push your code to github and you see it on github, then you should be able to push your code to heroku with no problem. If not you may be doing something wrong with git locally on your computer.
I had no idea why, but stopping running foreman in my local machine allowed a push to heroku master... Could be coincidence :|

Can't push on heroku

I’ve just cloned one of my repositories on github, I've made some changes and I would like to send it on the heroku application. But when I try to run git push heroku master, I get :
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.
What can I do to solve it?
This is because there's no remote named heroku. You can see your remotes by typing git remote -v. For my 'example' app I see the following:
$ git remote -v
heroku git#heroku.com:example.git (fetch)
heroku git#heroku.com:example.git (push)
If it's missing, you can add the remote with the following command:
git remote add heroku git#heroku.com:example.git
where example is the name of your heroku app.
Before you can do
$ git push heroku master
you need to setup heroku by following the steps given at Getting Started with Heroku. Once you have setup heroku, logged in,created your app.
Verify that git remote is added
$ git remote -v
it should list a remote named heroku. if it does then the error heroku' does not appear to be a git repository will go away
If you have followed the steps in tutorial you just need to login in again:
cmd "heroke login"

Resources