Display a list of active repositories
プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。
目的
- The purpose of this knowledge article is to provide methods for displaying a list of active repositories within your workspace, as well as exporting this information
- At present, Bitbucket Cloud lists your repositories based on their last activity dates - but there is no way of exporting this information natively within the product
方法
Option 1 - Bitbucket Cloud UI
To simply list your repositories within the UI, you can follow the steps below:
- First, ensure you have selected the correct workspace where you wish to view the repositories by clicking your avatar in the top-right hand corner and selecting All Workspaces from the dropdown menu, then select the correct workspace from the list
- Click the Repositories tab in the top navigation bar
- You will now see the list of repositories in your workspace, these are ordered chronologically based on when they were last active by default
Option 2 - Bitbucket Cloud API
You can also use our REST API to filter through the repositories under your workspace and display only active repositories by following the steps below:
- First, ensure that you have configured an authentication method such as an App Password or a repository access token with repository read access permissions (minimum) as you will need to use one of these authentication methods to access our API endpoint
You can then execute cURL commands using a terminal (or a utility such as Postman/Insomnia) against the /2.0/repositories endpoint to list all of your workspace repositories, with the option of filtering & sorting these to show only active repositories
Example:You will need to replace the placeholder values contained within the { } symbols with actual values (do not include the { } symbols in your commands)
# Simple repository list - App Password curl -X GET --user {Username}:{AppPassword} https://api.bitbucket.org/2.0/repositories/{WorkspaceID} # Simple repository list - Access Token curl -X GET \ --url https://api.bitbucket.org/2.0/repositories/{WorkspaceID} \ --header 'Authorization: Bearer {AccessToken}' # Repository list sorted from most recently to least recently updated - App Password curl -X GET \ --url 'https://api.bitbucket.org/2.0/repositories/{WorkspaceID}?sort=-updated_on' \ --user {Username}:{AppPassword} # Repository list sorted from most recently to least recently updated - Access Token curl -X GET \ --url 'https://api.bitbucket.org/2.0/repositories/{WorkspaceID}?sort=-updated_on' \ --header 'Authorization: Bearer {AccessToken}' # Repository list that only shows repositories updated after a certain date (YYYY-MM-DD) - App Password curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{WorkspaceID}?q=updated_on%3E2025-01-01' \ --user {Username}:{AppPassword} # Repository list that only shows repositories updated after a certain date (YYYY-MM-DD) - Access Token curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{WorkspaceID}?q=updated_on%3E2025-01-01' \ --header 'Authorization: Bearer {AccessToken}' # Repository list that only shows repositories updated before a certain date (YYYY-MM-DD) - App Password curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{WorkspaceID}?q=updated_on%3C2025-01-01' \ --user {Username}:{AppPassword} # Repository list that only shows repositories updated before a certain date (YYYY-MM-DD) - Access Token curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/{WorkspaceID}?q=updated_on%3C2025-01-01' \ --header 'Authorization: Bearer {AccessToken}'
Option 3 - Python Script
There is also an unofficial Python script that may be used to gather a list of repositories with their last active dates, and export these in .csv format:
警告
NOTE: This is a third-party script that is not formally supported by Atlassian, if you encounter any issues we will not be able to provide scripting assistance as this falls outside of our support scope. We would suggest having your team review this before executing it in production.
- Ensure Python is installed on your local machine
- Download the script here and read its instructions, then execute it locally on your machine
If you are unable to successfully gather the information that you require after following this article - please feel free to raise a support ticket or raise a community support ticket for further assistance.