{"id":5655,"date":"2019-10-22T09:22:15","date_gmt":"2019-10-22T14:22:15","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=5655"},"modified":"2019-10-22T09:55:24","modified_gmt":"2019-10-22T14:55:24","slug":"5655","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=5655","title":{"rendered":"Git Log"},"content":{"rendered":"<p><a href=\"https:\/\/git-scm.com\/docs\/git-log\">Git log<\/a> can be used to get a quick summary of the differences between two branches. The three dots between the branch names indicates you want a \u201csymmetric difference\u201d. That is the set of commits that are in the branch on the left or the branch on the right <em>but<\/em> not in both branches.<\/p>\n<p>The &#8211;left-right option prefixes each commit with an \u2018&lt;\u2019 or \u2018&gt;\u2019 indicating which \u201cside\u201d has the commit. The &#8211;oneline option prints the abbreviated commit ID and the first line of the commit message.<\/p>\n<p>Showing the differences between your local uat branch and the remote uat branch:<\/p>\n<p>D:\\git\\gittest&gt;git log &#8211;left-right &#8211;oneline origin\/uat&#8230;uat<\/p>\n<p><span style=\"color: #993300;\">&gt; 961f53a<\/span> (<span style=\"color: #339966;\">uat<\/span>) Merge branch &#8216;ossa-123&#8217; into uat<\/p>\n<p><span style=\"color: #993300;\">&gt; 803096b<\/span> (<span style=\"color: #ff0000;\">origin\/ossa-123<\/span>, <span style=\"color: #339966;\">ossa-123<\/span>) Added additional files<\/p>\n<p><span style=\"color: #993300;\">&gt; cf9c419<\/span> Added initial code to branch<\/p>\n<p>The top line is the most recent commit, the bottom line is the oldest commit that does not exist in both branches. I can see that the uat branch in my local repo is not missing anything from the remote (there are no commits with &#8220;&lt;&#8221; indicating changes in the remote that do not exist in my local copy) but I have local changes which have not yet been pushed: two code commits plus the merge commit which incorporated the code commits to my local repo&#8217;s uat branch. The head of the local and remote ossa-123 branch are at the commit just prior to the merge, so <em>on my local repo<\/em> that branch has been fully merged into UAT and I just need to push uat up to the remote.<\/p>\n<p>Additional options to enhance output:<\/p>\n<p>&#8211;cherry-pick will omit any changes that represent the same changes in both branches (or &#8211;cherry-mark to mark those commits with an \u201c=\u201d flag)<\/p>\n<p>&#8211;graph uses an ASCII chart to depict branch relationships.<\/p>\n<p>* The three dots mean something different in git diff than in git log. In git diff, mean \u201cwhat are the differences between the right-hand branch and the common ancestor shared by both the right and left-hand branches\u201d.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"684\" height=\"226\" class=\"wp-image-5656\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/10\/word-image-2.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/10\/word-image-2.png 684w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/10\/word-image-2-300x99.png 300w\" sizes=\"auto, (max-width: 684px) 100vw, 684px\" \/><\/p>\n<p>Two dots in git diff mean is the differences that are in the branch on the left or the branch on the right <em>but<\/em> not in both branches.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"263\" class=\"wp-image-5657\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/10\/word-image-3.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/10\/word-image-3.png 688w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2019\/10\/word-image-3-300x115.png 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/p>\n<p>In git log, two dots displays only commits unique to the second branch. Since commits and differences are not exactly the same thing, two and three dots don\u2019t <em>exactly<\/em> have the opposite meaning between diff and log. But the meaning is not logically consistent.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git log can be used to get a quick summary of the differences between two branches. The three dots between the branch names indicates you want a \u201csymmetric difference\u201d. That is the set of commits that are in the branch on the left or the branch on the right but not in both branches. The &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[233],"class_list":["post-5655","post","type-post","status-publish","format-standard","hentry","category-coding","tag-git"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5655"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5655\/revisions"}],"predecessor-version":[{"id":5659,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5655\/revisions\/5659"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}