Table: bitbucket_branch - Query Bitbucket Branches using SQL
Bitbucket is a Git-based source code repository hosting service owned by Atlassian. Bitbucket branches represent independent lines of development within a repository. They allow developers to work on features or fixes without interfering with the main (or 'master') codebase, and can be merged back into the main codebase when the work is complete.
Table Usage Guide
The bitbucket_branch
table provides insights into branches within Bitbucket. As a developer or DevOps engineer, explore branch-specific details through this table, including branch name, type, and associated commit. Utilize it to uncover information about branches, such as their current status, the associated commit, and the overall structure of development within a repository.
Important Notes
- You must specify the
repository_full_name
in thewhere
clause in order to query this table. - You must have admin access to the repository in order to access the branch restrictions.
Examples
List branches in a repository
Explore the branches within a specific repository to understand their default merge strategies and types. This can be useful for managing and optimizing your project's workflow within Bitbucket.
select name, repository_full_name, default_merge_strategy, typefrom bitbucket_branchwhere repository_full_name = 'souravthe/test1';
select name, repository_full_name, default_merge_strategy, typefrom bitbucket_branchwhere repository_full_name = 'souravthe/test1';
List branches with merge_commit
default merge strategy
Explore which branches within a specific repository utilize the 'merge_commit' as their default merge strategy. This is useful for understanding the merging practices and strategies within your project.
select name, repository_full_name, default_merge_strategy, typefrom bitbucket_branchwhere repository_full_name = 'souravthe/test1' and default_merge_strategy = 'merge_commit';
select name, repository_full_name, default_merge_strategy, typefrom bitbucket_branchwhere repository_full_name = 'souravthe/test1' and default_merge_strategy = 'merge_commit';
Schema for bitbucket_branch
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
default_merge_strategy | text | Branch default merge strategy. | |
heads | jsonb | Branch head details. | |
links | jsonb | Branch link details. | |
merge_strategies | jsonb | Branch merge strategies. | |
name | text | = | The name of the branch. |
repository_full_name | text | = | The repository full name. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
target | jsonb | Branch target details. | |
title | text | Title of the resource. | |
type | text | The branch type. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- bitbucket
You can pass the configuration to the command with the --config
argument:
steampipe_export_bitbucket --config '<your_config>' bitbucket_branch