_ChangeProtocol

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

robotsnoindex
robotsnoindex

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

git@bitbucket.org :< accountname>/<reponame>.git

or

ssh://git@bitbucket.org /< accountname>/<reponame>.git

HTTPS URL formathttps://<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:

  1. 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/master

    As 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.

  2. Open the ~/<path_to_repo>/.git/config file with your favorite editor.
  3. 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
Last modified on Jun 17, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.