Merging and pushing to remote repository fails
プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。
*Fisheye および Crucible は除く
問題
Repository merging/pushing with/to a remote branch in Script task does not work.
原因
Bamboo creates Git workspaces copying a minimal set of data:
git init
git fetch <remote-branch-ref>:<local-branch-ref>Moreover Bamboo uses repository caching. It means that code is first fetched from remote repository to a local cache and then another fetch is made from this cache to a workspace that is placed in Plan's working directory. Thus said even if clone operations were performed instead of init/fetch combo we'd be still pushing to a remote which would actually be a local cache instead of real remote repository.This way Bamboo copies only a branch that should be build. Side effect of this is that workspace is not a full clone with information about all branches.
ソリューション
Use Source Control task introduced in Bamboo 6.7+
この内容はお役に立ちましたか?