On 29.03.2024 20:20, Michael Ernst wrote:
[...]
What do you think of this feature request?
I wanted to propose to mark the relevant files as binary as that should
prevent the merge to happen. But this is not working.
git init
echo "*.txt binary" > .gitattributes
git add .gitattributes
git commit -m ".gitattributes: Add it" .gitattributes
echo "a" > test.txt
git add test.txt
git commit -m "test.txt: main" test.txt
git checkout -b feature
echo "ab" > test.txt
git commit -m "test.txt: feature" test.txt
git checkout main
git merge --no-ff --stat --no-edit feature
Merge made by the 'ort' strategy.
test.txt | Bin 22 -> 3 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
git log -p test.txt
commit ec7cab2fa30c26738c6254202a399a616959a661 (feature)
Author: Thomas Braun <thomas.braun@xxxxxxxxxxxxxxx>
Date: Mon Apr 1 12:56:07 2024 +0200
test.txt: feature
diff --git a/test.txt b/test.txt
index 346a56a..81bf396 100644
Binary files a/test.txt and b/test.txt differ
commit 61e195554351dada7494e4eb4935d96120680420
Author: Thomas Braun <thomas.braun@xxxxxxxxxxxxxxx>
Date: Mon Apr 1 12:50:29 2024 +0200
test.txt: main
diff --git a/test.txt b/test.txt
new file mode 100644
index 0000000..346a56a
Binary files /dev/null and b/test.txt differ
I would have expected to see a merge conflict as git can't know how to
merge binaries. Or am I misunderstanding something here?