Меню Закрыть

Git could not resolve host

Содержание

Comments

Copy link Quote reply

shiv1490 commented Jun 5, 2018 •

Description

I create a new repository in my local and complete the changes . After that I opened my github desktop to push the changes to my GitHub repo. As soon as i click the publish button it gave me this error

Version

  • GitHub Desktop:1.22
  • Operating system: windows 10 64 bit

Steps to Reproduce

Expected Behavior

Should publish new repository

Actual Behavior

gave this error — fatal: unable to access ‘https://github.com/shiv1490/Burger-Builder.git/’: Could not resolve host: github.com

Additional Information

This comment has been minimized.

Copy link Quote reply

niik commented Jun 5, 2018

Hey @shiv1490. This error message seems to indicate a connectivity problem. Do you currently have any antivirus software installed other than the default antivirus that ships with Windows?

Additionally, are you using a proxy server to access the internet? Git requires special configuration to work behind proxy servers, see #1998, #2789

This comment has been minimized.

Copy link Quote reply

shiv1490 commented Jun 11, 2018

Hi All,
Issue is resolved now. This was happening because I was behind a corporate proxy. I used below commnad to resolve the issue

This comment has been minimized.

Copy link Quote reply

Jaaess commented Jun 22, 2018

This comment has been minimized.

Copy link Quote reply

imsrgadich commented Aug 14, 2018

Check this out as well. it helped me.

This comment has been minimized.

Copy link Quote reply

DoganM95 commented Nov 27, 2018 •

in my case it was a firewall rule (cmd not having internet permission), created by the company i work for

This comment has been minimized.

Copy link Quote reply

kutajay commented Feb 3, 2019

Tried the following
git config —global http.proxy http://proxyuser:[email protected]:8080 and
git config —global —unset http.proxy
git config —global —unset https.proxy
but none seems to work for me; could it be a possible internet strength isssue?

This comment has been minimized.

Copy link Quote reply

SethuSP commented Apr 4, 2019

Tried the following
git config —global http.proxy http://proxyuser:[email protected]:8080 and
git config —global —unset http.proxy
git config —global —unset https.proxy
but none seems to work for me; could it be a possible internet strength isssue?

I too tried the same. It does not work for me as well and i do not think it is related to internet strength. Not sure why.

This comment has been minimized.

Copy link Quote reply

JCDigital27 commented Apr 12, 2019

This method works for me!
reboot>
then establish connection to internet.
then>
#git config —global —unset http.proxy
#git config —global —unset https.proxy
then>
#git clone https://(. ).git

This comment has been minimized.

Copy link Quote reply

dav >Jun 17, 2019

Why does this fix work?
What is it about the http/s.proxy global config that interferes with the internet connection?

This comment has been minimized.

Copy link Quote reply

steveward commented Jun 17, 2019

@davidbeery The —unset flag can fix the issue where Git will attempt to establish a connection through an invalid proxy configuration (i.e. the user is actually not behind a proxy), which causes Git operations to error out. If you are using a proxy then you will want to keep that proxy configuration line in order to ensure Git operations work successfully.

Читайте также:  2 Гис аптеки самара

This comment has been minimized.

Copy link Quote reply

RoderickKennedy commented Sep 5, 2019

@JCDigital27 i have the same problem, whe i use the solution, but it not work?
when i use curl -I https://github.com, it show the error.
curl: (6) Could not resolve host: github.com; Unknown error

This comment has been minimized.

Copy link Quote reply

manishak-kumari commented Sep 16, 2019

@shiv1490 👍
the command worked with me.
git config —global http.proxy http://proxyuser:[email protected]
should i copy and paste the same line given by you above or i need to do some change?

This comment has been minimized.

Copy link Quote reply

sadkisoft commented Sep 19, 2019 •

Please i need a help
My code is :

the result is 👍
int 6
string ‘Could not resolve host: api.sellercenter.net; Host not found’ (length=60)
int 0
boolean false

This comment has been minimized.

Copy link Quote reply

steveward commented Sep 19, 2019

@sadkisoft this issue tracker is for GitHub Desktop — if you have specific programming questions I’d recommend our Community Forum or StackOverflow.

This comment has been minimized.

Copy link Quote reply

keshri1 commented Dec 25, 2019

Check this out as well. it helped me.

What I did: I have created a remote repository on Github and I am trying to clone the remote repository on my local machine. While cloning I am providing the clone URL & target folder.

But every time I try to clone, I am getting this error:

Error: "fatal: unable to access ‘https://github.com/hyperion057/spring-repo.git/’: Could not resolve host: github.com"

What do I need to do to connect to GitHub ?

24 Answers 24

do i need to configure proxy settings? because my office has got proxy servers.

Yes, you can do so by setting HTTP_PROXY , and HTTPS_PROXY environment variables.

Note the NO_PROXY , to allow to access internal site to your company

You also can register that in your git config:

But if you have incorrect proxy Git settings, remove them:

I got a similar error, and it’s caused by incorrect proxy setting. This command saved me:

Spent a couple hours trying to fix this.

Re-connecting my wifi did the trick.

another possibility, I ran into this problem myself. But it was after I had installed a VPN (which was unrelated and running)

turning off the VPN, fixed the issue.

for the record, I was running "Viscosity" VPN on my MacBookPro

I’ve had the same issue after running out of disk space. Closing and reopening terminal fixed it one time. Restarting my Mac the next.

Some easy things to try before jumping to random commands:

  • restart terminal tab
  • restart terminal app
  • If disk is full (or close to it) free up some disk space then restart terminal app
  • restart machine/OS

192.30.252.128 is the current IP of github.com which can be set in your local DNS (/etc/hosts in Linux and C:WindowsSystem32driversetchosts)

Would like to note, when I did Brian’s solution:

make sure to quit and restart terminal. Mine didn’t resolve until I did that.

Thanks so much, issue was killing me!

i have same issue and solve it by using this command

In my case, on a Windows box, my TCP/IP stack seems to have needed to be reset. Resetting the TCP/IP stack of the client PC caused git to start behaving properly again. Run this command in Administrator mode at a command prompt and retry the git command:

Читайте также:  Укажите пару взаимно простых чисел

Manually disabling and re-enabling the network adapter via the Control Panel produces a similar result.

I suspect DNS resolution problems inside the TCP stack on my Windows box.

I had this very similar error as following.

Actually, the prompt message has told us where’s wrong.

When I check my github, I found my github repository’s HTTPS url is

I don’t know how this happened. The wrong url has been set up by installed Git Shell automatically.

Once I remove the ‘/’ at the end, I can push successfully.

All, I want to let you all know that I was having this same issue. I solve it by resetting my remote URL git remote set-url origin https://new.url.here I found how to do this from this answer but I had to change hit to https: Change the URI (URL) for a remote Git repository

Just in case future generations stuck in this too: For me what worked (on mac OSX) was to set my DNS with opendns 208.67.222.222 , 208.67.220.220. I get this numbers here: https://www.opendns.com. For some reason, my dns configuration reseted to the default numbers (my local ip I guess), and I was not able to connect to neither github, brew or rubygems. Sorry for the misspelling.

Today I face with the same issue, this is also providing another possibility. I did all suggestions above but still seeing the issue. I have no way but restart my mac. Problem solved.

When you tried above solutions and nothing helps, you may need to checkout your local network settings and try to add 8.8.8.8 and your local router ip to the DNS filed.

As a suggestion for Ubuntu servers, you can write down essid and password of router in your /etc/network/interfaces file:

When I got this error while pulling a repository to my server, I wrote wpa-ssid and wpa-psk and restarted. Then it worked.

EDIT: I faced the same issue again and this time it was because of the inconsistency in router signal levels. My connection was not strong, that was the problem. However, the solution above is a real solution for static ip

Что я сделал: я создал удаленный репозиторий в Github, и я пытаюсь клонировать удаленный репозиторий на моем локальном компьютере. При клонировании я предоставляю URL-адрес клонирования и целевую папку.

Но каждый раз, когда я пытаюсь клонировать, я получаю эту ошибку:

Ошибка: "фатальный: невозможно получить доступ" https://github.com/hyperion057/spring-repo.git/ ‘: не удалось разрешить хост: github.com"

Что мне нужно сделать, чтобы подключиться к GitHub?

мне нужно настроить параметры прокси? потому что в моем офисе есть прокси-серверы.

Да, вы можете сделать это, установив переменные среды HTTP_PROXY и HTTPS_PROXY .

Обратите внимание на NO_PROXY , чтобы разрешить доступ к внутреннему сайту вашей компании

Вы также можете зарегистрировать это в своем git config:

Но если у вас неправильные настройки Git прокси, удалите их:

Я получил аналогичную ошибку, и это вызвано неправильной настройкой прокси. Эта команда сохранила меня:

Прошло пару часов, пытаясь исправить это.

Повторное подключение моего WiFi сделало трюк.

Другая возможность, я столкнулся с этой проблемой сам. Но это было после того, как я установил VPN (который был несвязан и запущен)

Читайте также:  Установка mac os на macbook с нуля

отключив VPN, исправлена ​​проблема.

для записи, я запускал VPN "Вязкость" на моем MacBookPro

У меня была такая же проблема после исчерпания дискового пространства. Закрытие и повторное открытие терминала исправили его один раз. Перезагрузка моего Mac следующая.

Несколько простых вещей, которые нужно попробовать, прежде чем переходить к случайным командам:

  • перезапустите вкладку терминала
  • перезапустить приложение терминала
  • Если диск заполнен (или близок к нему), освободите место на диске и перезапустите приложение терминала.
  • перезагрузить машину/ОС

192.30.252.128 — текущий IP-адрес github.com, который может быть установлен в вашем локальном DNS (/etc/hosts в Linux и C:WindowsSystem32driversetchosts)

Хотелось бы добавить, потому что я этого не делал, как только вы ввели:

обязательно закройте и перезапустите терминал. Мой не решил, пока не сделал это.

Большое спасибо, вопрос убил меня!

у меня та же проблема и решить ее с помощью этой команды

В моем случае, в ящике Windows, мне кажется, что стек TCP/IP должен быть reset. Сброс стека TCP/IP клиентского ПК заставил git снова начать правильно. Запустите эту команду в режиме администратора в командной строке и повторите команду git:

Вручную отключение и повторное включение сетевого адаптера с помощью панели управления дает аналогичный результат.

Я подозреваю проблемы разрешения DNS внутри стека TCP в моем окне Windows.

У меня была такая же ошибка, как и следующая.

Собственно, подсказка сообщила нам, где не так.

Когда я проверяю свой github, я обнаружил, что мой HTTPS-адрес репозитория github

Я не знаю, как это произошло. Неправильный URL-адрес был настроен с помощью установленной оболочки Git.

Как только я удаляю ‘/’ в конце, я могу успешно нажать.

Все, Я хочу, чтобы вы все знали, что у меня такая же проблема. Я разрешаю это, сбросив мой удаленный URL git удаленный исходный источник URL-адреса https://new.url.here Я нашел, как это сделать из этого ответа, но я пришлось изменить https: Изменить URI (URL) для удаленного репозитория git

На всякий случай будущие поколения тоже застряли в этом: Для меня то, что работало (на Mac OSX), было для установки моего DNS с помощью opendns 208.67.222.222, 208.67.220.220. Я получаю эти цифры здесь: https://www.opendns.com. По какой-то причине моя конфигурация DNS была сброшена на номера по умолчанию (мой локальный ip, я думаю), и я не смог подключиться ни к github, ни к w610, ни к rubygems. Извините за неправильное письмо.

Когда вы пробовали решения и ничего не помогали, вам может потребоваться проверить настройки локальной сети и попытаться добавить 8.8.8.8 и ваш локальный маршрутизатор к DNS .

Сегодня я столкнулся с той же проблемой, это также дает еще одну возможность. Я сделал все предложения выше, но все еще вижу проблему. У меня нет способа, но перезапустите мой mac. Проблема решена.

В качестве предложения для серверов Ubuntu вы можете записать essid и пароль маршрутизатора в файле /etc/network/interfaces :

Когда я получил эту ошибку, вытаскивая репозиторий на свой сервер, я написал wpa-ssid и wpa-psk и перезапустил. Тогда это сработало.

EDIT: я снова столкнулся с той же проблемой, и на этот раз это было из-за несогласованности в уровнях сигнала маршрутизатора. Моя связь не была сильной, это была проблема. Однако вышеприведенное решение является реальным решением для статического ip

Рекомендуем к прочтению

Добавить комментарий

Ваш адрес email не будет опубликован.