Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot push onto Github repository

Tags:

git

github

I am having trouble pushing code from my machine to github. I have setup the repos:

git remote add origin [email protected]:hugeeee/demo_app.git

I get this error when type the command git push -u origin master:

ssh: Could not resolve hostname github: Name or service not known
fatal: The remote end hung up unexpectedly

Can anybody please direct me towards the solution?

like image 496
Hugs Avatar asked Oct 24 '11 17:10

Hugs


People also ask

Why can I not push to GitHub?

This error mainly occurs when you attempt to push your local changes to GitHub while the local repository (repo) has not yet been updated with any changes made in the remote repo. So Git is trying to tell you to update the local repo with the current changes in the remote before pushing your own changes.

Why is my git push not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

Why is git push being rejected?

A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do not have locally. What this means is that your local git repository is not compatible with the remote origin.


1 Answers

Run this:

git remote set-url origin [email protected]:hugeeee/demo_app.git

Make sure you actually say "github.com". You probably left out the ".com" when you created the remote.

like image 102
rob mayoff Avatar answered Oct 18 '22 00:10

rob mayoff