← Back to Git Course | Chapter 4: Remote Repositories | Lesson 9 of 11

Git Bitbucket Introduction

What is Bitbucket?

Bitbucket is Atlassian's Git hosting service, notable mainly for its tight native integration with Jira for issue tracking and Confluence for documentation -- you connect it to a local repository as a remote exactly like GitHub or GitLab.

Example: What is Bitbucket?

bash
git remote add origin https://bitbucket.org/user/repo.git

Cloning from Bitbucket

Cloning from Bitbucket works the same as any other host: grab either the HTTPS or SSH URL from the repository page and run git clone <url>, and Git configures the origin remote automatically.

Example: Cloning from Bitbucket

bash
git clone https://bitbucket.org/user/repo.git

Managing Remotes

If a Bitbucket repository's URL changes -- say, after a workspace rename -- git remote set-url origin <new-url> updates it without disturbing any local history; renaming the remote itself is a separate, optional step.

Example: Managing Remotes

bash
git remote set-url origin https://bitbucket.org/newworkspace/repo.git

Working with Bitbucket Pipelines

Bitbucket Pipelines is Atlassian's built-in CI/CD tool, configured through a bitbucket-pipelines.yml file committed to your repository, letting you define automated test and build steps that run on every push.

Example: Working with Bitbucket Pipelines

bash
echo "pipelines:\n  default:\n    - step:\n        script:\n          - npm test" > bitbucket-pipelines.yml

Setting Up SSH Keys

SSH keys let you authenticate to Bitbucket without typing a password on every push or pull -- once you've added your public key to your Bitbucket account, ssh -T [email protected] confirms the connection is working correctly.

Example: Setting Up SSH Keys

bash
ssh -T [email protected]

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.