bitbucket can't pull/push from repository

So basically I have a server where I have bitbucket git repository set up. I’ve been using it for months and now out of the blue sky when I try to pull I get the following error:

ssh: Could not resolve hostname bitbucket.org: 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’m 100% sure I have correctly setup my ssh-keys.

  • Github: show tags in commits history
  • How much space can your BitBucket account have?
  • Git pull fatal: Out of memory, malloc failed
  • JIRA smart commit - Block git commit without JIRA ticket number
  • Bitbucket with android :“Can't publish part of repository” error
  • Git push new project permission denied
  • git remote -v
    origin  git@bitbucket.org:marel/tshirtmafia.git (fetch)
    origin  git@bitbucket.org:marel/tshirtmafia.git (push)
    

    Any suggestions how to fix this ? Please let me know if you need anything else.

  • How to check if remote branch exists on a given remote repository?
  • Git or Subversion for a TFS user
  • Redmine & Git integration
  • Git Track File Existance Only, Not File Contents
  • Git Pull Doesn't Do A Git Fetch
  • Ignore certain changes for git commit
  • 8 Solutions collect form web for “bitbucket can't pull/push from repository”

    This worked for me.
    I had added google DNS server details in NetworkPreference.

    8.8.8.8,8.8.4.4

    This issue is caused by incorrect git configuration.
    Open .git folder in root folder and find the line that starts with

    url = git@bitbucket.org

    Most probably you have specified protocol there and defined url like
    url = ssh://git@bitbucket.org

    remove ssh:// and it should do the trick for you.

    I don’t know the exact cause for this issue.First thing to is to ping bitbucket.org. If you are getting response then follow that steps below.

    Go to .git folder of you repo, use your favorite editor.open config
    file and change the url value as shown below.Worked for me.

    https://bitbucket.org/<username>/<repo>  -> https://<username>@bitbucket.org/<username>/<repo>
    

    Same steps will fix ssh issue also, Just add username.

    In the picture is my notes repo , where i save all my notes
    enter image description here

    The error message suggests a DNS or network issue.
    If this is a linux box you could investigate the output of a few networking commands such as ifconfig, host bitbucket.org, and follow some guides on troubleshooting DNS issues for your specific environment.

    As sreekumar said, the idea is to preset the DNS and it is detailed here

    Changing DNS server settings on Windows 7

    1. Go to the Control Panel.
    2. Click Network and Internet > Network and Sharing Center > Change adapter settings.
    3. Select the connection for which you want to configure Google Public DNS. For example:
      • To change the settings for an Ethernet connection, right-click Local Area Connection > Properties.
      • To change the settings for a wireless connection, right-click Wireless Network Connection > Properties.
      • If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
    4. Select the Networking tab. Under This connection uses the following items, select Internet Protocol Version 4 (TCP/IPv4) or Internet Protocol Version 6 (TCP/IPv6) and then click Properties.
    5. Click Advanced and select the DNS tab. If there are any DNS server IP addresses listed there, write them down for future reference, and remove them from this window.
    6. Click OK.
    7. Select Use the following DNS server addresses. If there are any IP addresses listed in the Preferred DNS server or Alternate DNS server, write them down for future reference.
    8. Replace those addresses with the IP addresses of the Google DNS servers:
      • For IPv4: 8.8.8.8 and/or 8.8.4.4.
      • For IPv6: 2001:4860:4860::8888 and/or 2001:4860:4860::8844.
      • For IPv6-only: you can use Google Public DNS64 instead of the IPv6 addresses in the previous point.
    9. Restart the connection you selected in step 3.
    10. Test that your setup is working correctly
    11. Repeat the procedure for additional network connections you want to change.

    This seems a lot like the issue I’m facing. In my case the problem was related to IPv6 (for details see: Can't push/pull to bitbucket via SSH when behind VPN. IPv6 issue?). The workaround was to add AddressFamily inet to my .ssh/config file under the Host bitbucket entry, which forces that connection to use IPv4.

    This basically means that you are unable to establish a connection with the bibucket because your network isnt allowing you to do so. Try installing the certificates and then use the “git clone” command to clone your repo.
    c:–>program files –>git –>usr –>ssl –>cer and install the certificates by clicking on ca-bundle and ca-bundle.trust
    Worked for me . Let me know how it helps you 🙂

    Just in case none of those answers helped, in my case I was using a “ghost” terminal session. The output of “whoami” was showing some unknown user, and the solution was to close and open a new console window.

    Git Baby is a git and github fan, let's start git clone.