Git and Seeting What Commits Are Not In Another Branch

A common question I get from co-workers is, “How do I see if I already merged my changes into my master branch?”. My usual suggestion was to use git diffbut I've started telling them to look atgit cherry` (NOT git-cherry-pick).

From the new Git documentation, git-cherry finds commits not merged upstream.

I use it like this while on the master branch to see what commits are in master that are not on the feature-branch-name branch:

$ git cherry -v master feature-branch-name

The -v option prints out the commit SHAs and messages. If I am already on the feature-branch-name branch, I can type the following to get the same effect:

$ git cherry -v master

The results typically looks something like:

%2B a4d0f79fccbbc12a53e8f0e5c2a4ef960ad69ba2 commit 1 message
%2B 7e71afd1faf36f17a0ff506e63cd2ca51496dad3 commit 2 message
%2B 5e815ece05d8813354e60ca1affb8cdb8c5d78fc commit 3 message
%2B 956f4cec5684544066a0d261ff8ac80aff7a57ea commit 4 message
%2B 6c6cdb4342ed935f8fbd38f48f51dec469dd1823 commit 5 message
%2B c3481fd0d6279f5bd45c455b915e0b4b1c0d8909 commit 6 message

That means those commits are on feature-branch-name branch but not in master

Jason Meridth

jmeridth

My name is Jason Meridth. I am a continuously learning senior software developer/devops/team lead/development manager trying to not let best be the enemy of better. I reserve the right to change my mind upon obtaining more information. I am also the owner and principal software consultant at Meridth, LLC. If you have any software, hardward, networking, process, etc needs please don't hesitate to reach out to me.

Raspberry Pi Kubernetes Cluster - Part 2

Howdy again.Alright, my 8 port switch showed up so I was able to connect my raspberry 3B+ boards to my home network. I plugged it in wit...… Continue reading

Raspberry Pi Kubernetes Cluster - Part 1

Published on April 07, 2018

SSH - Too Many Authentication Failures

Published on March 28, 2018