In what instance would git cherry-pick be needed instead of git merge? -
for moving individual 1 branch realize there few options in git. have experimented git merge
, git cherry-pick
failing see when git cherry-pick
preferable.
my understanding following:
git merge <hash>
moves specified commit 1 branch other preserving 1 commit.
git cherry-pick <hash>
creates copy of commit in second branch separate own commit hash.
the first option seems preferable me instances when cherry-pick
preferred?
say have branch master
has bunch of commits. maybe made change appropriate on master
, don't want bring in all of changes (a small bug fix, example, or addition of small feature). git cherry-pick
, can grab only commit other branch , bring master
.
Comments
Post a Comment