When Cherry-Picking Might Fail

Learn how you can handle scenarios where cherry-pick might fail.

We'll cover the following

Cherry-pick not easily applied

A case where the cherry-pick is not easily applied is outlined below. It’s exactly the same as the run-through in the previous lesson. But this time, the “crazy change” is not added at the top of the file, but in a line affected on the other branch also.

1	mkdir lgthw_cherry_pick_2
2	cd lgthw_cherry_pick_2
3	git init
4	echo change1 > file1
5	git add file1
6	git commit -am change1
7	echo change2 >> file1
8	git commit -am change2
9	git log --all --oneline --decorate --graph
10	git branch experimental
11	git checkout experimental
12	echo crazy change >> file1

Get hands-on with 1200+ tech skills courses.