27
nshastri@N-SHASTRI ~/datasciencecoursera (master) $ git push origin master 

ssh: Could not resolve hostname https: no address associated with name

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

2
  • 1
    so, what's your actual question? Commented Sep 19, 2014 at 10:22
  • maaster will be master???? Commented Sep 19, 2014 at 10:54

5 Answers 5

54

Simply type:

git remote -v 

and double-check the url associated with origin for your upstream repo.

Once you have the right url, update your remote origin with another git remote command:

git remote set-url origin /the/right/url 

In your case, the url is wrong:

https:/github.com/nkshastri/datasciencecoursera.git # instead of: https://github.com/nkshastri/datasciencecoursera.git ^^^^ 

Simply type:

git remote set-url origin https://[email protected]/nkshastri/datasciencecoursera 

Then try again:

git push -u origin master 

(with master, not maaster)

Sign up to request clarification or add additional context in comments.

16 Comments

Thanks for help I tried doing it and still no success. I am posting a screen shot for reference.
@NarendraKumarShastri what os and git version are you using?
My os is windows 7 Git bash version is version 1.9.4-preview20140815
@NarendraKumarShastri what is the output of git remote -v (no screenshot, just the text)
I am not able to post sceen shot so output is:nshastri@N-SHASTRI ~/datasciencecoursera (master) $ git remote -v origin https:/github.com/nkshastri/datasciencecoursera.git (fetch) origin https:/github.com/nkshastri/datasciencecoursera.git (push)
|
15

Sometimes this can be caused by a network issue. Try restarting your wifi or, if the repository is behind a VPN, make sure you are on the VPN.

1 Comment

occured after restarting the server..disabling/enabling wifi on my mac solved it for now :)
0

You are probably trying to connect a FALSE NAME DIR your repository name should be the SAME as your folder name in local environment.

git repo: gitRepo folder name: gitRepo now you can push

it is also a good practice to first CLONE your new repository to a different folder and then you can COPY your code to this new folder and then change its name to the right git repository name.

Comments

0

For me in ~/.git-credentials I have two credential is has been stored. So I keep one that I want to interact now push, pull working fine.

For more information about git-credentials follow this link

Comments

0

This solution is applicable only for small projects...

To get around this... I created a new directory with files having the same name as in the old directory.

Simply copy-pasted the code from old files to the corresponding files of the new directory...

Then did the usual command chain...

git remote add URL_OF_YOUR_REPO git branch -M main git status git add . git commit -m "Problem Solved!" git push -u origin main 

Didn't face any error after this. Useful for small repos.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.