_ChangeProtocol
The URL you use for a repo depends on which protocol you are using, HTTPS or SSH. The Clone button of your repository has a quick way for you to see these URLS.
A. Clone button: Click this button to clone a repository.
B. Protocol, clone command: Pick HTTPS or SSH and copy text to the command line.
Experiment for a moment, clicking back and forth between the SSH and the HTTPS protocol links to see how the URLs differ. The table below shows the format based on protocol.
SSH URL format |
or |
---|---|
HTTPS URL format | https://<accountname>@bitbucket.org/< accountname>/<reponame>.git |
To make the change, go to a terminal on your local system and navigate to your repository locally. Then, do the following:
View your current repo configuration.
You should see something similar to the following:$ cd ~/<path_to_repo>
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://emmap1@bitbucket.org/emmap1/bitbucketspacestation.git
[branch "master"]
remote = origin
merge = refs/heads/masterAs you can see, the
url
is using the HTTPS protocol. There are a number of ways to change this value, the easiest way is just to edit the repo's configuration file.- Open the
~/<path_to_repo>/.git/config
file with your favorite editor. Change the
url
value to use the SSH format for that repo.
When you are done you should see something similar to the following:[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git@bitbucket.org:emmap1/bitbucketspacestation.git