git submit code with error "fatal: unable to access ': Could not resolve host: domain.com"

czmike 注册会员
2023-02-26 19:06

Part of this answer references GPT, GPT_Pro to better solve the problem
This is a common problem caused by a DNS resolution failure. The domain name.com may not be resolved correctly, causing git to not connect to the server properly. In this case, you can try the following methods:

  1. Check whether the DNS server is working properly, and if it is not, fix it;
  2. Check whether the hosts file contains the IP address of the domain name.com. If no, manually add it.
  3. Try git push and git pull again;
  4. Run the git remote -v command to check whether the current remote address is correct. If not, you can reset the remote address using the git remote set-url command.
git remote set-url origin https://域名.com/user/repo.git
  1. Try using an HTTP proxy. You can set up Git HTTP proxy using the following command:
git config --global http.proxy http://proxy-server-ip:port
  1. Try to use SSH to connect to the server, you can use the following command to set up the Git SSH connection:
git config --global url.ssh://git@域名.com/user/repo.git.insteadOf https://域名.com/user/repo.git

If the answer is helpful, please accept it.

daiyuanrui 注册会员
2023-02-26 19:06

The following answers are quoted from GPT-3 model, please use them wisely:



1. 检查域名解析是否正确,如果不正确则修改域名解析;

2. 尝试使用ip地址而不是域名访问git仓库来测试是否能够正常访问;

3. 在git客户端本地设置hosts文件,将域名解析指向正确的ip地址。



1. 打开本地的hosts文件,一般位于C:\Windows\System32\drivers\etc\hosts,在文件中加入如下内容: example.com

2. 保存并重启本地的Git客户端软件。

3. 使用新的hosts文件即可正常访问git仓库。

Please accept my answer if it answers your question

dfzxdmy110 注册会员
2023-02-26 19:06
< div class = "md_content_show e397 data - v - 3967" = "" >

thank you still want to rely on human experience summary. GPT-3 big model and it lists the possibilities.

medicmagic 注册会员
2023-02-26 19:06

To solve this problem, you only need to set the network proxy.
Run the following command on the CLI:
git config --global --unset http.proxy
git config --global --unset https.proxy

About the Author

Question Info

Publish Time
2023-02-26 19:06
Update Time
2023-02-26 19:06

Related Question


GIT Extensions and a separate working directory



.NET6 Razor Pages : Url.Page() works, but LinkGenerator.GetPathByPage() in a IHostedService returns null