Posted 8 days ago. Visible to the public. Repeats.

Deployment: Merge consecutive commits without cherry-picking

You want to deploy new features but the latest commits are not ready for production? Then use git merge master~n to skip the n-last commits.

Tip

A big advantage of merging vs. cherry-picking is that cherry-picking will create copies of all picked commits. When you eventually do merge the branch after cherry-picking, you will have duplicate commit messages in your history.

Example

It's time for a production deployment!

Copy
git log --pretty=format:"%h - %s" --reverse origin/production..origin/master 0e6ab39f - Feature A 6396de5f - Feature B c3347545 - Bug fix 8be80057 - Feature C # not yet tested c278611b - Refactoring # not yet tested git checkout production git merge master~2

In this example we are merging Feature A, Feature B and Bug fix but not the untested commits Feature C and Refactoring.

This is the same as merging the commit referenced by master~n, so in this case

Copy
git merge c3347545

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

Owner of this card:

Avatar
Julian
Last edit:
4 days ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Julian to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more