Catalog / Bitbucket Cheat Sheet
Bitbucket Cheat Sheet
A quick reference guide to Bitbucket, covering essential Git commands and Bitbucket-specific features for effective version control and collaboration.
Basic Git Commands
Configuration
|
Sets the name you want attached to your commit transactions. |
|
Sets the email you want attached to your commit transactions. |
|
Lists all git configurations. |
Starting a New Repository
|
Initializes a new Git repository in the current directory. |
|
Clones an existing repository from a URL (e.g., Bitbucket). |
Basic Workflow
|
Adds a file to the staging area. |
|
Adds all modified files to the staging area. |
|
Commits staged changes with a descriptive message. |
|
Pushes local commits to a remote repository (e.g., Bitbucket). |
|
Pulls changes from a remote repository to your local branch. |
|
Shows the status of the working directory and staging area. |
Branching and Merging
Branch Management
|
Lists all local branches. The current branch is highlighted. |
|
Creates a new branch. |
|
Switches to the specified branch. |
|
Creates a new branch and switches to it. |
|
Deletes a branch (if it’s already merged). |
|
Force deletes a branch (even if it’s not merged). |
Merging Branches
|
Merges the specified branch into the current branch. |
|
Launches a merge tool to resolve conflicts during a merge. |
|
After resolving conflicts, commit the merged changes. |
Remote Branches
|
Deletes a branch on the remote repository. |
|
Fetches the latest changes from the remote repository without merging. |
|
Lists all remote connections. |
|
Lists remote branches |
Bitbucket Specific Features
Pull Requests
Pull requests are a core feature for code review and collaboration in Bitbucket.
|
Bitbucket Pipelines
Bitbucket Pipelines allows you to automate your build, test, and deployment workflows directly within Bitbucket.
Example
|
Bitbucket Cloud
Private Repositories |
Bitbucket offers free private repositories for small teams. |
Integrations |
Integrates with Jira, Trello, and other Atlassian products. |
REST API |
Provides a REST API for automating tasks and integrating with other systems. |
Advanced Git Techniques
Stashing
|
Temporarily saves changes that you don’t want to commit immediately. |
|
Applies the most recent stashed changes and removes it from the stash. |
|
Lists all stashed changes. |
|
Applies a specific stashed change without removing it from the stash. |
|
Removes a specific stashed change. |
Rebasing
Rebasing is an alternative to merging that integrates changes from one branch into another by rewriting the commit history.
|
Ignoring Files
|
Create a Example:
|