How to get a list of repository forks in Bitbucket Server and Data Center

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

このページの内容はサポート対象外のプラットフォームに関連しています。したがって、アトラシアン サポートではこのページの記載内容のサポートの提供は保証されません。この資料は情報提供のみを目的として提供されています。内容はお客様自身の責任でご利用ください。

要約

This article explains how to get a list of repositories that are forks together with the repositories from which they originate.

環境

Bitbucket 8.11, but also applicable to other versions.

ソリューション

The following database query provides a list of repositories that are forks together with repositories from which they originate.

  • Using database queries:
    • The first four columns are related to the repository forked from others.
    • The last four columns are related to the original repository that is forked from.
-- list of repositories with forks
select
        p.project_key project,
        p."name" project_name,
        p.project_type project_private,
        r.slug repo,
        --
        po.project_key fork_of_project,
        po."name" fork_of_project_name,
        po.project_type fork_of_project_private,
        ro.slug fork_of_repo
    from sta_repo_origin sro
    join repository r on r.id = sro.repository_id
    join project p on p.id = r.project_id
    join repository ro on ro.id = sro.origin_id
    join project po on po.id = ro.project_id
    order by
        p.project_key,
        r.slug;
curl --request GET \
  --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/forks' \
  --header 'Accept: application/json;charset=UTF-8'



最終更新日: 2025 年 2 月 20 日

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

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