Git Bitbucket Introduction
In this page:
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?
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
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
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
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
ssh -T [email protected]
Chapter Quiz — Complete all 11 topics to unlock
0/11 topics done
Complete these topics first: