Unix-style line endings are being converted to windows-style (CRLF) line endings when Git checkout is performed on Bamboo Windows elastic agent

お困りですか?

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

コミュニティに質問


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

Server* 製品のサポートは 2024 年 2 月 15 日をもって終了します。Server 製品を利用している場合は、Atlassian Server のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

    

要約

Unix-style line endings in files are being converted to windows-style (CRLF) line endings when Git checkout is performed on Bamboo Windows elastic agent.

環境

  • Windows elastic agent
  • Git for Windows

原因

The default value for Git for Windows for core.autoclrf is true after installation. Bamboo stock elastic images use the default for the Git for Windows installer. This means that when a Git checkout is performed on a Windows machine the LF line endings are converted to CRLF. 

ソリューション

If this is not desirable there are a few options:

オプション 1:

Configure a custom Bamboo elastic agent image with core.autoclrf set to false globally before snapshotting it:

オプション 2:

Set git config --global core.autoclrf false in a Script task before the source-code checkout on builds that execute on Windows agents.

オプション 3:

Add a .gitattributes to your repository which controls line ending styles and end of line normalization through the text  and eol  attributes:


最終更新日: 2021 年 10 月 1 日

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

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