githubteacher / github-for-developers-sept-2015

practice repo for the Sept 29-30 GitHub for Developers class
12 stars 36 forks source link

Why did you use git cherry-pick from the hotfix branch instead of pulling from master? #716

Closed milindrao closed 8 years ago

jaw6 commented 8 years ago

In this scenario, we're imagining a developer working on a feature branch wants to have a single commit from the hotfix to continue their work on feature branch. It's probably not the most common scenario here -- I'd guess it's more common to rebase the feature branch on master after a hotfix has been merged -- but it does come up in some environments.

milindrao commented 8 years ago

Thanks. That makes sense.

But you used the phrase "rebase the feature branch on master". Is that the CVS/SVN term rebase which merges changes in master to the branch? Or the Git "rebase" which is rewrite the commit histories?

jaw6 commented 8 years ago

Or the Git "rebase" which is rewrite the commit histories?

That's the one I mean -- and, in general, merge works just as well as rebase or cherry-pick -- the point we're trying to highlight in demonstrating cherry-pick is a scenario where you want to bring exactly one commit, not a whole chain of commits.