Bitbucket

Bitbucket Cheatsheet #

Bitbucket is a code hosting platform that provides Git repository management, code reviews, and CI/CD features for software development.

General Commands #

Command/OptionExampleDescription
git clone <repo_url>git clone https://bitbucket.org/user/repo.gitClone a repository from Bitbucket
git fetchgit fetch originFetch changes from the remote repository
git pullgit pull origin mainPull changes from the remote repository and merge

Branch Management #

Command/OptionExampleDescription
git branchgit branchList all branches in the repository
git branch <branch_name>git branch feature-branchCreate a new branch
git checkout <branch_name>git checkout feature-branchSwitch to a different branch
git merge <branch_name>git merge feature-branchMerge a branch into the current branch
git branch -d <branch_name>git branch -d feature-branchDelete a branch

Commit Management #

Command/OptionExampleDescription
git add <file>git add .Add files to the staging area
git commit -m "message"git commit -m "Add new feature"Commit changes with a message
git pushgit push origin mainPush changes to the remote repository

Pull Requests #

Command/OptionExampleDescription
git push origin <branch_name>git push origin feature-branchPush a branch to Bitbucket to create a pull request
bitbucket pr createbitbucket pr create --title "New Feature" --source branch_name --destination mainCreate a new pull request
bitbucket pr listbitbucket pr listList all pull requests
bitbucket pr merge <pr_id>bitbucket pr merge 123Merge a pull request
bitbucket pr decline <pr_id>bitbucket pr decline 123Decline a pull request

Repository Settings #

Command/OptionExampleDescription
bitbucket repo listbitbucket repo listList all repositories
bitbucket repo create <repo_name>bitbucket repo create my-repoCreate a new repository
bitbucket repo delete <repo_name>bitbucket repo delete my-repoDelete a repository

Access Management #

Command/OptionExampleDescription
bitbucket user listbitbucket user listList all users in the repository
bitbucket user add <user>bitbucket user add user@example.comAdd a user to the repository
bitbucket user remove <user>bitbucket user remove user@example.comRemove a user from the repository

CI/CD Pipelines #

Command/OptionExampleDescription
bitbucket-pipelines.ymlimage: node:12\npipelines:\n default:\n - step:\n name: Build\n script:\n - npm install\n - npm testExample configuration file for Bitbucket Pipelines
bitbucket pipelinesbitbucket pipelinesView the status of pipelines

This cheatsheet covers the most commonly used Bitbucket commands and options, helping you manage repositories, branches, commits, pull requests, settings, access, and CI/CD pipelines effectively.

Bitbucket

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.