9

Original question

From a few hours of struggling with installing git on Windows 7. First I installed the GitHub on Windows but not appealed to me. Then I installed the Git-1.9.2-preview20140411 and have started to have problems.

I suppose that there is a conflict by multiple installations. So I uninstalled everything. I decided to try Cygwin.

I acted according to this tutorial: How To install Git client on Windows using Cygwin By Johnathan Mark Smith

I added the generated public key SSH to my account on GittHub by Web browser . I created the first repository (through a browser).

After returning to the cygwin terminal and I typed:

git clone git@github.com:akawalko/ZFExt.git

I received such a result

Cloning into 'ZFExt'...
ssh: Could not resolve hostname github.com: Non-recoverable failure in name resolution
fatal: The remote end hung up unexpectedly

I do not understand this message. I did something wrong?

EDIT 1: To the person who gave me the minus one. In your opinion I shouldn't have asked. Instead, format the hard drive. In this way it would be okay?

Updated question

I started to ask google with less detailed questions and i found it: git and ssh: Could not resolve hostname, ping works. I changed my DNS addresses to open DNS and was able to clone my repo by using ip adres instead domain:

git clone git@192.30.252.128:akawalko/ZFExt.git some_git_repo/

Using domain name still not work:

git clone git@github.com:akawalko/ZFExt.git some_git_repo/
Cloning into 'some_git_repo'...
ssh: Could not resolve hostname github.com: Non-recoverable failure in name resolution
fatal: The remote end hung up unexpectedly

Any ideas (other then changing DNS)?

Community
  • 1
  • 1
donkey
  • 131
  • 1
  • 1
  • 7
  • 2
    There is no need to use Cygwin for Git on Windows, and hasn't been for several years. Unless you have a compelling reason I would avoid it. The [official website](http://git-scm.com/) should let you download an installer for the latest Git, and it works quite well. – ChrisGPT was on strike May 22 '14 at 21:29
  • @Chris Yep, I have a reason. The installer you pointed at will not work for me. Git will crush every time with message dumped to file identical to this: https://github.com/msysgit/msysgit/issues/25, except that I used latest release. – donkey May 23 '14 at 07:24
  • Have you tried using `rebase.exe` (unrelated to Git's `rebase`) to fix your problem, as outlined in the issue that you linked? – ChrisGPT was on strike May 23 '14 at 11:44
  • @Chris As I mentioned before, I currently don't have Git-1.9.2-preview20140411 installed, so I cannot try rebase.exe (how can I use it? just rebase.exe in bash? no parameters?). I will edit my question in couple of minutes. – donkey May 23 '14 at 12:16
  • I'm not sure how to use it, but that looks like a promising lead. I'd try to figure it out if I were in your position. – ChrisGPT was on strike May 23 '14 at 12:39
  • @Chris Use rebase.exe did nothing (reported error, so I probably did it wrong). I will use the IP address instead of github domain until solution come up (I don't want to format the hard drive). Thanks for your input. Will wait few days, then close the question. – donkey May 23 '14 at 17:41

7 Answers7

20

I had this issue inside a VMware Fusion VM. I had to change my network from NAT to Bridged and it started working.

Adam
  • 1,561
  • 2
  • 15
  • 25
  • I run Fusion 8.0.2 but cant use Bridged. Does not resolve an IP address. – Ramon Smits Nov 05 '15 at 10:19
  • I had the same issue! After starting a new VM that used bridged networking which did work my old VM for some reason also worked again in bridged mode, et voila, git ssh worked again. – Ramon Smits Nov 05 '15 at 13:19
  • Very bizarre. I also had this same issue after going from Fusion 7 to 7.1.3. – spartygw Oct 26 '16 at 13:34
9

For anyone else having this issue on VMWare Fusion and Windows 10, see this thread: https://communities.vmware.com/thread/518949?start=0&tstart=0

In summary, ssh won't do dns resolution over NAT on Fusion with Windows 10. This is a known bug, but in the meantime, add an entry to your host file to access bitbucket

131.103.20.167 bitbucket.org

Also, as @Jim Redmond pointed out, bitbucket is changing their IP addresses soon (December 15, 2016).

Another, more permanent, option would be to set Google as your DNS provider. Use 8.8.8.8 or 8.8.4.4. Or for ipv6: 2001:4860:4860::8888 or 2001:4860:4860::8844. https://developers.google.com/speed/public-dns/docs/using

MitchVz
  • 205
  • 2
  • 4
  • 11
  • Don't get too attached to that IP: https://blog.bitbucket.org/2015/12/03/making-bitbuckets-network-better-faster-and-ready-to-grow/ – Jim Redmond Dec 10 '15 at 04:50
5

For me, it started happening when I upgraded to Git 2.7.4. The fix in the link below worked for me, you need to change SSH configuration in \etc\ssh\ssh_config.

AddressFamily inet

See the last comment in the thread linked below:

Can't resolve hostname with SSH

Sergey
  • 2,303
  • 1
  • 18
  • 11
2

Summary

It's been a few days and I have not found any solution. In conclusion, it's more a problem with the operating system than the tools (Cygwin, Git).

I installed two competing Git clients (Git-1.9.2-preview20140411 and GitHub on Windows) which resulting in messed up windows registry. This gives in an error: STATUS_ACCESS_VIOLATION at eip=68086014. I returned to app GitHub For Windows and will use Windows Power Shell. It's far from perfect but it works.

I was so focused on problem mentioned above that I didn't spot problem with DNS. Because I don't have knowledge how to solve this problem (answers on stackoverflow didn't work for me) I will use the IP address instead of github domain in commands like git clone and others until I reinstall Windows. :-(

I have modified the title to more precise.

Big thanks to @Chris for his contribution.

donkey
  • 131
  • 1
  • 1
  • 7
1

I had the same problem .then I tried with account name prefixed in the domain. like try

git clone git@youraccountname.github.com:akawalko/ZFExt.git

it worked for me also make sure in your git config you are using the same url.

1

Experienced the same problem with Windows 7 and VmWare Fusion 8.5.3.

Tried 2 options. Both worked. But issue is weird. Seem to happen to github.com and bitbucket.com only.

  1. Setting DNS manually in adapter settings (e.g. 8.8.8.8)
  2. Change networking from NAT to Bridged
-4

For me it works fine when I changed the hostname to ip address.

Saber Xie
  • 1
  • 1