git push >> fatal: no configured push destination

Go To StackoverFlow.com

22

I'm still going through some guides on RoR and I'm stuck here at Deploying The Demo App

I followed instructions:

With the completion of the Microposts resource, now is a good time to push the repository up to GitHub:

$ git add .
$ git commit -a -m "Done with the demo app"
$ git push

What happened wrong here was the push part.. it outputted this:

$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
git push <name>

So I tried following the instructions by doing this command:

$ git remote add demo_app 'www.github.com/levelone/demo_app'
fatal: remote demo_app already exists.

So I push:

$ git push demo_app
fatal: 'www.github.com/levelone/demo_app' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

What can I do here? Any help would be much appreciated.

2012-04-05 17:11
by levelone
Please don't add signatures or taglines to your posts and please learn to use markdown in the editor rather than HTML tags - meagar 2012-04-05 17:31
@meagar Sorry, looks like I just override your edit ; - VonC 2012-04-05 17:33
Sorry about that @meagar i'm still new here have to get use to the markdowns in the editor - levelone 2012-04-06 01:49
Was there something wrong in my answer initially selected - VonC 2013-07-30 09:22
Very good question. Most tutorials seem to be missing one or two steps, making it impossible to push your changes - Kokodoko 2015-05-25 10:41


13

The command (or the URL in it) to add the github repository as a remote isn't quite correct. If I understand your repository name correctly, it should be;

git remote add demo_app 'git@github.com:levelone/demo_app.git'
2012-04-05 17:25
by Joachim Isaksson


13

You are referring to the section "2.3.5 Deploying the demo app" of this "Ruby on Rails Tutorial ":

In section 2.3.1 Planning the application, note that they did:

$ git remote add origin git@github.com:<username>/demo_app.git
$ git push origin master

That is why a simple git push worked (using here an ssh address).
Did you follow that step and made that first push?

 www.github.com/levelone/demo_app

wouldn't be a writable URI for pushing to a GitHub repo.

https://levelone@github.com/levelone/demo_app.git

should be more appropriate.
Check what git remote -v returns, and if you need to replace the remote address, as described in GitHub help page, use git remote --set-url.

git remote set-url origin https://levelone@github.com/levelone/demo_app.git
or 
git remote set-url origin git@github.com:levelone/demo_app.git
2012-04-05 17:25
by VonC
It works! @VonC but unfortunately I'm stuck right after I push once again... After using: git push demo_app it outputs a Password Authentication, and after successfully logging in it displays: No refs in common and none specified; doing nothing; perhaps you should specify a branch such as 'master'. Everything-up-to-date

i don't get it. - levelone 2012-04-06 01:57

@Marc if it asks for a password, then you must have missed a configuration allowing you to authenticate to GitHub as the rightful owner of demo_app. See for instance (with an https remote GitHub address) http://stackoverflow.com/questions/7129232/problem-in-pushing-to-github/7130405#7130405 or (more complete) http://stackoverflow.com/questions/5377703/syncing-with-github/5378094#537809 - VonC 2012-04-06 06:31
the first link didn't change the output of my push.. i'm curious on how to set my < logininternet >, < passwordinternet >, @ aproxy, aport ... i'm kinda lost :( sorry about that. hope i'm not bugging you for your help. - levelone 2012-04-07 09:21
@Marc: you only need to setup that if you do access internet through a proxy - VonC 2012-04-07 09:27
oh ok.. i access the net through our wifi here at home. i hope that helps? so yea when i push $ git push it displays this text error: error setting certificate verify locations: CA file: \bin\curl-ca-bundle.crt CApath: none while accessing https:\\levelone@github.com/levelone/demo_app.git/info/refs fatal:HTTPS request failed do i need my rails server on while i push it? or i do have to set up my proxy - levelone 2012-04-07 12:12
and i tried cloning it.. and destination path 'demo app' already exists and is not an empty directory - levelone 2012-04-07 12:19
@Marc check your global git config to set the CA file path appropriately: http://stackoverflow.com/a/3778244/6309. And when you clone, always do it by specifying a root directory which doesn't exist yet - VonC 2012-04-07 13:13
i found another solution.. i just redid the entire demo_app from scratch. and everything went smoothly in 10mins :P haha thanks for your help @VonC : - levelone 2012-04-07 16:20
@Marc Excellent. Glad you made it work in the end - VonC 2012-04-07 16:55
I am on bitbucket when I am doing this git remote add abc-blog 'git@bitbucket.org:sooraz/abc-blog.git'

I am getting fatal: remote abc-blog already exists and then can't push it.. - Suraj 2015-01-30 05:47

@Suraj that should be a separate question in its own, not a comment burried under a three-years old answer - VonC 2015-01-30 06:36
Sorry about that.. I saw your last active was just 10 minutes back and hence the comment - Suraj 2015-01-30 06:52
@Suraj sure, I am always there (http://meta.stackexchange.com/questions/122976/anyone-with-a-visited-2048-days-2048-consecutive-in-his-her-profile), but your question deserves more visibility: make one, for others (than just me) to answer to - VonC 2015-01-30 07:14
Ads