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?
The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.
ssh: Could not resolve hostname github.com: Temporary failure... fatal: Could not read from... You may be getting this error because you generated an ssh for your local machine and didn't add it to your GitHub account or because you added an ssh key to your GitHub account. This may also happen for some other reasons.
What is the meaning of error: 'Unable to resolve host name'? This error means that the hostname you are trying to connect to cannot be resolved to an IP address. (Hostnames are resolved to IP addresses by a DNS (Domain NameServer)). Please check what you have entered in the Address field.
I was getting the same error.
Change the [remote "origin"]
url
value in .gitconfig
or .config/git/config
file
Previously:
https://[email protected]:userName/repo.git
OR
ssh://[email protected]:userName/repo.git
New:
[email protected]:userName/repo.git
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