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 erro
Alright, as I am getting the hang of git, I would like to attempt to provide feedback/cherry pick on the easy stuff. The error "can't pull/push from repository" typically happens if the user you are using does not have rights to push to the desired remote git repository. If you are new, this should be your origin.
Check SSH Agent:
Check Remote: you are here because you are certain that git is installed on your machine, and that your present private key has had it's corresponding public key copied into your online git account. But you may be pushing to the wrong location. First check the branch that you are working on, were you pushing the right branch? Type;
git branch
You should see your branches listed with the present branch highlighted or with an asterisk in front of the name. If you wish to be pushing a different branch, check it out and continue. Then, confirm that you have the right url in origin, type;
git remote -v
Use the given output to confirm that you were pushing to the right remote. If not type;
git remote remove <name>
and follow that with
git remote add <name> <url>
this way when you push your code using
git push <name> <branch>
Everything should be pushed accordingly.
If after checking the above steps, you find that you are still locked out. Note, I assumed that you have a working internet connection. I would obviously setup git from scratch - not the same as reinstalling it, just setup it up and make sure you note the user setting up, and the passphrase that you are using. You should be fine.
Example URL: git@bitbucket.org:username/repository_name.git
This issue is caused by incorrect git configuration. Open .git folder in root folder of your project and in config file please 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
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.
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.
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 :-)