Git Set Remote from Bitbucket
Set Bitbucket Remote Origin
Now that your SSH key is added to Bitbucket, you can securely connect your local repository to Bitbucket using SSH.
Test Your SSH Connection
First, test that your SSH connection to Bitbucket works:
Example
ssh -T git@bitbucket.org
The authenticity of host 'bitbucket.org (104.192.141.1)' can't be established.
ED25519 key fingerprint is SHA256:*******************************************.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'bitbucket.org' (ED25519) to the list of known hosts.
Enter passphrase for key '/Users/user/.ssh/id_ed25519':
logged in as your-username
You can use git to connect to Bitbucket. Shell access is disabled
If the output contains your username on Bitbucket, you are successfully authenticated!
Get Your Repository's SSH Address
Note: The Bitbucket screenshots on this page show the default branch as master.
Bitbucket now names the default branch main, so you will see main where the screenshots show master.
On Bitbucket, go to your repository and click the Clone button. Make sure SSH is selected, then copy the SSH URL (it starts with git@bitbucket.org:):

Add or Update the Remote Origin
To add the remote origin (first time):
Example
git remote add origin git@bitbucket.org:your-username/your-repo.git
To update an existing remote to use SSH:
Example
git remote set-url origin git@bitbucket.org:your-username/your-repo.git
Congratulations! You are now ready to use Bitbucket with SSH.
GitHub
Bitbucket
GitLab