Recently, I have been asked to cherry-pick
a commit.
So what does cherry-picking a commit in git mean? How do you do it?
It will apply a particular commit to your current branch.
This means :
Ex: Consider commit A
added newFileA
modified main:
+ import './newFileA'
commit B
added newFileB
modified main:
+ import './newFileB'
If you cherry-pick commit B on another branch, you'll end up with :
/newFileB
/main :
import './newFileA'
import './newFileB'
since commit B contains newFileB and main, but no newFileA, resulting in a bug, so use with caution.