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.
$ git push Password for 'https://<repo_owner>@bitbucket.org':
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/).
$ cat ~/.ssh/id_rsa.pub | pbcopy
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:
$ git config --global url.ssh://<repo_owner>@bitbucket.org/.insteadOf https://<repo_owner>@bitbucket.org/
You can confirm that this works by checking your global configuration file and look for the insteadOf:
$ cat ~/.gitconfig [url "ssh://<repo_owner>@bitbucket.org/"] insteadOf = https://<repo_owner>@bitbucket.org/
Now, you’ll be able to push code changes to BitBucket without being prompted for a password.