Git Cherry Grab Configuration

need help! There are problems with the cherry keel. I create a * .sh file with the following sequencing ( execute in an empty folder! ):

 #!/bin/sh

git init

echo "init" >> file.txt && git add . && git commit -m "commit init" 

git checkout -b develop

for i in $(seq 1 8)
do 
    echo $i >> file.txt && git add . && git commit -m "commit $i" && git tag v$i 
done

git checkout master

git checkout -b some_other_branch

git cherry-pick v5

If you completed it, you will find that it is in a conflicting state during the cherry blossom. This fact is fine for me, but if you open the file.txt file , you will find there all the changes 1,2,3,4,5 , and not as I expected, only 5.

init
<<<<<<< HEAD
=======
1
2
3
4
5
>>>>>>> 0ea6510... commit 5

But I want to see only 5 as diff.

init
<<<<<<< HEAD
=======
5
>>>>>>> 0ea6510... commit 5

How can i do this? Maybe I will set various additional properties?

+4
source share

Source: https://habr.com/ru/post/1617959/


All Articles