By default, my BitBucket Git repository uses the HTTPS URL instead of the SSH. As a result, I get prompted for my password every time I push code to my BitBucket Git repository.
[code language=”bash”]
$ git push
Password for ‘https://<repo_owner>@bitbucket.org’:
[/code]
You should see your BitBucket account username in place of <repo_owner> . If you want to avoid having to do this every time, you must configure BitBucket to have your SSH Key. Therefore, copy your SSH key (or generate one if you haven’t already) and add it your account settings in BitBucket (ie, https://bitbucket.org/account/user/<repo_owner>/ssh-keys/).
[code language=”bash”]
$ cat ~/.ssh/id_rsa.pub | pbcopy
[/code]
Now, you must configure your Git to use SSH instead of HTTPS. You can do this globally for all Git repos on your machine/account, by doing the following:
[code language=”bash”]
$ git config –global url.ssh://<repo_owner>@bitbucket.org/.insteadOf https://<repo_owner>@bitbucket.org/
[/code]
You can confirm that this works by checking your global configuration file and look for the insteadOf:
[code language=”bash”]
$ cat ~/.gitconfig
[url "ssh://<repo_owner>@bitbucket.org/"]
insteadOf = https://<repo_owner>@bitbucket.org/
[/code]
Now, you’ll be able to push code changes to BitBucket without being prompted for a password.
Sources:
Wow that was unusual. I just wrote an incredibly long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Anyway, just wanted to say fantastic blog!
As I website possessor I believe the subject material here is really great, thankyou for your efforts.
I precisely wished to thank you very much once more. I’m not certain the things that I would’ve implemented without the type of opinions discussed by you directly on this concern. It was an absolute fearsome issue in my view, however , witnessing the very professional form you treated the issue took me to cry over gladness. I’m just happy for your service and as well , have high hopes you comprehend what a great job that you are carrying out training others through your web blog. Most likely you haven’t met any of us.
Pretty section of content. I just stumbled upon your weblog and in accession capital to assert that I get actually enjoyed account your blog posts. Anyway I’ll be subscribing to your augment and even I achievement you access consistently fast.
Thank you for all your valuable work on this site. My mom enjoys working on internet research and it’s really easy to understand why. Most people notice all of the powerful tactic you offer both useful and interesting solutions through the website and even welcome response from other individuals on this point and our own princess is undoubtedly starting to learn a whole lot. Have fun with the remaining portion of the year. Your conducting a pretty cool job.
I together with my pals came following the best tips and hints found on the blog and all of a sudden got an awful suspicion I never expressed respect to the web site owner for them. All the young boys were certainly warmed to see all of them and have in effect truly been loving them. Many thanks for genuinely really thoughtful as well as for figuring out these kinds of marvelous areas millions of individuals are really needing to understand about. My very own sincere regret for not expressing appreciation to you sooner.
A lot of thanks for your whole effort on this web site. My niece take interest in making time for research and it is obvious why. We notice all about the dynamic tactic you create valuable thoughts on this web blog and in addition boost response from website visitors on the subject matter so our own child is certainly becoming educated a whole lot. Enjoy the remaining portion of the new year. You are carrying out a fantastic job.
I and my friends happened to be examining the good tricks from your site and unexpectedly I had a terrible suspicion I never thanked the web site owner for those secrets. These boys became absolutely happy to read through them and have without a doubt been using these things. Thank you for truly being indeed helpful and for using this sort of superb ideas millions of individuals are really wanting to know about. Our honest apologies for not saying thanks to earlier.
Thanks for your whole hard work on this website. Kim really loves getting into investigation and it’s really easy to understand why. My spouse and i learn all regarding the lively tactic you offer rewarding tips by means of your web site and strongly encourage contribution from the others about this matter while our simple princess is without question understanding a lot. Enjoy the rest of the year. You’re the one conducting a really good job.
I wanted to develop a small message so as to appreciate you for some of the nice solutions you are giving on this site. My incredibly long internet look up has finally been honored with awesome facts and strategies to exchange with my great friends. I ‘d assume that we website visitors actually are extremely lucky to exist in a remarkable network with many outstanding professionals with interesting tactics. I feel pretty happy to have come across the web pages and look forward to so many more entertaining moments reading here. Thanks a lot once again for all the details.
Generally I don’t learn article onn blogs, however I wijsh too say that this write-up ery compellked me to ttake a lok
at and do it! Yoour writing tasste haas been surprised me.
Thanmk you, very gret article.