From 2b9d1faabf5b1d74c2c27c09d105b63205fa8a3d Mon Sep 17 00:00:00 2001 From: Guiorgy Date: Sat, 2 Aug 2025 21:20:24 +0400 Subject: [PATCH] docker: Force Unix line endings on docker/ files When using git on Windows, git may try to "fix" line endings to CRLF. Then, when building the Docker image, the files copied can end up having the wrong line ending, which causes scripts to fail to run. This patch fixes the problem by using .gitattributes to indicate to git which line ending to use for the files in the docker/ directory. https://github.com/albertito/chasquid/pull/66 Amended-by: Alberto Bertogli Adjusted commit message, extended comment on .gitattributes. --- .gitattributes | 5 +++++ .gitignore | 1 + 2 files changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0047ebb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Force Unix style line endings for files that will be copied into the Docker +# image. This is helpful when using git on Windows, as it prevents the wrong +# newlines to be copied inside the Docker image, which can cause scripts to +# fail to run. +docker/* text eol=lf diff --git a/.gitignore b/.gitignore index 408046a..c2d4851 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # Exceptions to the rules above: files we care about that would otherwise be # excluded. !.gitignore +!.gitattributes !.clang-format !.github/