0

I've created a new repository on Github and want to do my first push. All the commands worked until "git push -u origin master", when the following error is prompted:

ssh: Could not resolve hostname github.com:MaryCooperGD: Name or service not   known
 fatal: Could not read from remote repository.

I've tried following this solution and all the other answers below but didn't work. I've deleted the credentials on the credential manager but git doesn't ask me for new credentials to enter. I've tried closing and reopening the bash but nothing changed. What can I try?

UPDATE: I was able to push by using git remote set url origin with the right URL. Finally git prompted to insert username and password, I inserted mine and the push went ok. The problem is that the commit I see on the repository is under the name of the previous github account that was on the computer, even though I've deleted the credentials and inserted mine.

Usr
  • 2,628
  • 10
  • 51
  • 91
  • what is the result of your `git remote -v` ? – ymonad Feb 12 '19 at 09:14
  • @ymonad origin ssh://git@github.com:MaryCooperGD/progetto-I.git (fetch) origin ssh://git@github.com:MaryCooperGD/progetto-I.git (push) – Usr Feb 12 '19 at 09:15
  • maybe you can try changing it using `git remote set-url origin git@github.com:MaryCooperGD/progetto-I.git` – ymonad Feb 12 '19 at 09:20
  • @ymonad updated the question – Usr Feb 12 '19 at 09:25
  • The user account shown in commit history of GitHub seems to be determined by the Author's E-Mail of the commit, not who pushed it. Check it using `git log`. – ymonad Feb 12 '19 at 09:33
  • @ymonad yes, it's like that... how can I change? Do I Have to delete my project? – Usr Feb 12 '19 at 09:36
  • You can rewrite your commit history: https://help.github.com/articles/changing-author-info/ . by the way, since you are asking two questions, you should ask another question in StackOverflow if you want more help. – ymonad Feb 12 '19 at 09:38

0 Answers0