From: Julien Maurel Date: Wed, 06 Nov 2024 20:24:35 GMT Subject: Question about merge & cherry pick Message-ID: <711a0faa-6d82-48b6-819d-9ddbeda03f6a@maurel.me> Hi, I detect a potential issue with usage of merge and cherry pick. I do a short script to reproduce my use case. From my point of view, after these operations, content on branch master and dev should be same with "zZz" on second line and "eDe" on last one. But it's not the case on second line... I test the same thing with first commit on master, cherrypick on dev, second update on dev, merge dev on master, result is same. And I test to cherry pick second commit on master after final merge, cherry pick is ok and "fix" master content. Can you help me to understand if it's normal or not ? The script : mkdir repo cd repo # Create a file and init 2 branches with same content git init echo -e "aAa\nzZz\nqQq\neEe" > file git add . git commit -a -m "init" git checkout -b dev # Update on dev sed -i "s#Z#Y#" file git commit -a -m "update" # Cherrypick on master git checkout master git cherry-pick -x dev # Second update on dev git checkout dev sed -i "s#Y#Z#" file sed -i "s#E#D#" file git commit -a -m "update that change second line as before first update and do another change" # Merge on master git checkout master git merge dev --no-ff -m "Merge" # Display result echo echo echo MASTER cat file git checkout dev > /dev/null 2>&1 echo echo DEV cat file Thanks