Posted about 7 years ago. Visible to the public. Repeats.

Git: Advisory for cherry-picks to production branches

We often have a separate production branch that lags a bit behind the more cutting edge master branch. Sometimes you want to move some, but not all commits from master to production. This can be done with a git cherry-pick.

However, this may lead to considerable pain later, since git does not understand the commits are actually "the same". Hazards are unnecessary and hard to resolve conflicts as well as incorrect auto-merges.

In order to avoid this, always merge the production branch back to the master after the cherry-pick. Even though this will make the cherry-picked commits appear twice in master, both branches will now have a common base again.

So the full workflow to move the AWESOME_COMMIT_SHA1 to production is:

Copy
git checkout production git cherry-pick AWESOME_COMMIT_SHA1 git checkout master git merge production

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Author of this card:

Avatar
Tobias Kraze
Last edit:
over 1 year ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more