---
title: "Bitbucket Set-Up"
canonical: "https://kb.uconn.edu/space/IKB/26491683057/Bitbucket%20Set-Up"
format: markdown
---
Bitbucket is a Web UI/Online Git repository manager. A cloud version of Bitbucket with [Pipelines](https://uconn.atlassian.net/wiki/spaces/IKB/pages/26496827477) is available. 

## General Uses: 

- Can be used to collaborate on code with inline comments and pull requests.
- Can create, manage, and share Git (with version control) repositories to build and ship software.
- Can perform lightweight code reviews.

## Access and Configuration: 

1. Login to the Bitbucket Cloud [uconnbitbucket](https://bitbucket.org/uconnbitbucket/workspace/repositories/) workspace with your NetID credentials.
2. You will need to either [update the remote URLs](https://support.atlassian.com/bitbucket-cloud/docs/change-the-remote-url-to-your-repository/) for all repositories or re-clone them from Bitbucket Cloud. When cloning from Bitbucket Cloud for the first time, you will be prompted to grant access between the repository and your client. If you’re logged into the VPN, you may receive a “Could not resolve host: [bitbucket.org](http://bitbucket.org)” message. You will need to disconnect and clone your repository.
3. Click “Initials” upper right corner, then select “Account settings”.
4. In the top menu, select “Security” and scroll down to “API tokens” section.
5. Click “Create and manage API tokens”
6. Click “Create API token with scopes”
  1. Name: “give it a meaningful name”
  2. Expires on: “have it expire in 1 year” that’s the max.
  3. Next
  4. Select “Bitbucket” from API token app and others if applicable
  5. Next
  6. Scope type: select the ones you want (admin, read, write, etc.)
  7. Next
  8. Create token
  9. Copy the API token and save it
7. To authenticate with Bitbucket Cloud using an API token:
  1. You will need the API token and your Bitbucket email address for Bitbucket APIs
  2. You will need the API token and your Bitbucket username for Git commands (click “cog” upper right corner, select Personal Bitbucket settings, in Account Settings, scroll down to Bitbucket profile settings, get your username.)
8. Now, while in Visual Studio
  1. Open terminal and go to the base repository folder (project folder)
    1. Go to the .git subfolder of that base folder (Cd in .git/config file)
      1. Edit the config file
        1. Find the line with “ url = “
        2. Add a colon after your username and then paste the new token you created, leaving everything after, and including “@bitbucket.org”
          - E.g. url = https://<username>**:<token>          **@bitbucket.org/uconnbitbucket/<bitbucket_project.git>
      2. Save the file
      3. Perform some testing by editing a file and committing it
    

## Tips

- Your Bitbucket username may be different than your NetID. Click on Account Settings to take note of your Bitbucket username.
- If you have access to multiple workspaces in the cloud, click on your avatar in the upper right corner, then select the workspace to switch back and forth between workspaces.
- If you are creating a new project, do not use a hyphen "-" as part of the project key.  You can use an underscore "_".
- If you are creating new repositories, please add a unique value to the name.  For example, you can use the project key as a prefix.
- If you experience an authentication error in SourceTree, you can delete this [file: C:\Users\<netid>\AppData\Local\Atlassian\SourceTree\passwd](#).
- If you cannot view repos within your projects, try clearing your cache. (Or test in private / incognito window.).


### Next

[Bitbucket Pipelines](https://uconn.atlassian.net/wiki/spaces/IKB/pages/26496827477)

## Related Articles

> Macro (contentbylabel)