Git Submodules URL are not updated for repositories imported into Bitbucket Server or 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 は除く

要約

After importing code from other Git hosting providers into Bitbucket, Git submodule URLs are not automatically updated.

In this sample, we have a repo called main-repo in Bitbucket Cloud (bitbucket.org) that has a submodule called submod-repo1:

The .gitmodules file in main-repo contains the URL for repo submod-repo1:



When both the main-repo and submod-repo1 repositories are imported into Bitbucket Server/Data Center, it might be assumed that the URL in the .gitmodules file will be updated to reflect Bitbucket Server's base URL.

However, the submodule URL is not changed and still refers to the source.

For the sample above, the .gitmodules file would still contain the following, which still points to the Bitbucket Cloud repo:


This is expected behaviour. 

Bitbucket does not update any repository content during import, so the .gitmodules file is not updated.

In addition, it is not possible to know in advance what the intended URL for the submodule should be. Git allows the main repo to be on one remote location and have submodule(s) to be in other remotes.

ソリューション

Update the submodule URL in the .gitmodules file manually.

最終更新日 2023 年 4 月 25 日

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

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