After I switched from HTTPS to SSH for my repo then I received this error when pushing to origin master:
ssh: Could not resolve hostname git: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I also add my ssh in the gitlab. What should I do?
解决方案
I was getting the same error.
I changed the [remote "origin"] url value in .git/config file and now it's working fine.
Previously:
https://git@github.com:userName/repo.git
OR
ssh://git@github.com:userName/repo.git
New:
git@github.com:userName/repo.git