Merging Git LFS repository failing due to local changes

お困りですか?

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

コミュニティに質問

プラットフォームについて: 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 は除く

問題

When using repositories with Git Large File Storage (LFS) and a merging scheme such as Gatekeeper, the merge fails with the following error in the build log:

Merge command error: com.atlassian.bamboo.plugins.git.GitCommandException: command /path/to/bin/git merge --no-commit <hash> failed with code 128. Working directory was [<bamboo-home>/xml-data/build-dir/serverSide/<job-key>/mergeWorkspace]., stderr:
error: Your local changes to the following files would be overwritten by merge:
<list of files>
Please commit your changes or stash them before you merge.
Aborting

診断

Diagnostic Steps

  1. Run git config -l in the repository directory
    • If the following is not included in the output, you may be affected by this issue:

      filter.lfs.clean=git-lfs clean -- %f
      filter.lfs.smudge=git-lfs smudge -- %f
      filter.lfs.process=git-lfs filter-process
      filter.lfs.required=true

原因

This issue is caused by Git LFS not being initialized on the system by the user running Bamboo. This is because Git LFS will add a pointer to each file, which will be seen as an update to non-LFS repositories.

ソリューション

Please run git lfs install in a Git repository as the Bamboo user. This will initialize Git LFS for all repositories on your system.

This configuration is per user, so if you have previously run git lfs install as another user, you do still need to run it as the Bamboo user.

Note: If you only want to initialize Git LFS for one repository, you can do this by running git lfs install --local in the repository where you would like to use Git LFS.

参考

 

最終更新日 2018 年 11 月 1 日

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

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