Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT - fatal: Could not resolve host: bitbucket.org

I understand there are many Git questions like mine and I can assure you I've been scraping the web and trying all solutions, to the point where I need to post my own question.

General Info:
OS: Windows 7
Git Version: 1.9.0.msysgit.0
ssh version: OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007

Git Error Message:

E:\git-projects\project-psl-v3>git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

ssh: bitbucket.org: no address associated with name
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

So the question:

How can I resolve this issue and push up to the remote repository?
I didn't change anything on my PC (windows update possibly?).
I can commit locally, I have the correct ssh keys in place.
I've tried cloning another repo, same error message.
I do have the correct privileges.
I've tried via https also, same error message.
I've reinstalled ssh and git, same error message.
I have also changed my dns to 4.2.2.1 and 8.8.8.8, same error message.
There is also no proxy on my internet options.

Any alternative ideas on solving this issue will be greatly appreciated.

Cheers in advance,
Rhys

like image 224
RhysBradbury Avatar asked Apr 08 '14 09:04

RhysBradbury


2 Answers

As weird as it may sound, restarting the computer worked as I believe it was caused by abnormal shutdown of my computer.

like image 133
M.Fauzdar Avatar answered Sep 20 '22 17:09

M.Fauzdar


I had the same message and on the commandline changed my settings to

git config --global push.default current

...so it will always use my current branch as default to push.

In your repository you could do a git config -l to overview the settings for your repository. This will show all settings: System-, global- and projectwide.

Regarding SSH: Could it be possible you need to setup a ssh shortcut in your ssh-config named "bitbucket.org" so you are able to issue a ssh bitbucket.org command on your commandline? I found a few examples for this searching the internet for "ssh config file"

Check this manual for the SSH Part: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git

like image 33
chris polzer Avatar answered Sep 21 '22 17:09

chris polzer