I have a commit on a different branch that simply adds a bunch of files in a new directory.
Let's say the commit has id 123456
and it adds a directory called foo
full of stuff.
Now in my other branch, from a clean working tree, I do git cherry-pick 123456
, expecting it to just add the foo
directory.
But no! the cherry pick fails and includes loads of other changes to other files(!) giving me unmerged paths.
Surely the commit you're cherry-picking must contain some stuff you didn't know about/expect, then? Well, no, git show --oneline --name-status 123456 | grep -v foo
returns nothing. i.e. all there are no changes that happen to any files outside of foo
.
What is happening and how can I cherry pick this commit properly?