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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With