Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bitbucket git push stuck

Hi just set up a new bitbucket account and created a repo. I already have code in my local machine so I added the remote using git remote add now when i did git push origin, it prompted me to put password for the bitbucket account. After i entered the password, it just appears to be stuck. i ran git push on verbose mode but after I put the password it seems to be stuck.

Also I added my ssh key to bitbucket thinking that might help resolve the issue if it was authentication issue, but it still asks me for the password and get stuck after i provide it.

like image 533
bond Avatar asked Oct 24 '12 05:10

bond


2 Answers

For me the problem is IPv4 needs to be used for bitbucket - using IPv6 hangs at trying to establish a connection to port 22 on the ipv6 address..

To fix this - edit your /etc/ssh/ssh_config file and change

#AddressFamily any

to

AddressFamily inet

This forces ssh (and so git) to use ipv4 and not ipv6 sometimes

like image 111
cybafelo Avatar answered Sep 29 '22 07:09

cybafelo


Also I added my ssh key to bitbucket thinking that might help resolve the issue if it was authentication issue, but it still asks me for the password

It only adds a password if:

  • it cannot find your public/private keys (~/.ssh/id_rsa(.pub)): check, if you are on Windows, if %HOME% is defined)
  • the public key has been incorrectly copied over to bitbucket (typically with a newline in it)
  • your remote (git remote -v show) is still configured with https address.

ssh key

Check out the BitBucket Set up SSH for Git page, and try cloning your repo using the ssh address.
(Note: for step 5 on that Help page, see also "My .bashrc file not executed on Git Bash startup (Windows 7)").

like image 34
VonC Avatar answered Sep 29 '22 06:09

VonC