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:

  1. 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
  2. Click the Repositories tab in the top navigation bar
  3. 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:

  1. 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
  2. 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.

  1. Ensure Python is installed on your local machine
  2. 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. 

説明 Display a list of active repositories
製品Bitbucket Cloud
最終更新日: 2024 年 2 月 7 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.