{"thread":{"id":"46033","subject":"How do I see “merge events” in history?","startedAt":"2017-05-23T12:08:05Z","lastAt":"2017-05-23T12:20:58Z","messageCount":2,"participants":["Stefan Monov","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"320553","messageId":"CAJtFkWu25RkiKm0O__W2My+Adi9pxZ3YtjZW4eb+2U+wpNS3yA@mail.gmail.com","threadId":"46033","inReplyTo":null,"subject":"How do I see “merge events” in history?","fromName":"Stefan Monov","fromEmail":"logixoul@gmail.com","sentAt":"2017-05-23T12:07:40Z","receivedAt":"2017-05-23T12:08:05Z","isPatch":false,"sender":{"key":"logixoul@gmail.com","avatar":"https://gravatar.com/avatar/225c01274d1ead9f204fb7d8b871a9aad653bd3d80dd4356efc8c83fdbc750e4?d=mp&s=160"},"body":"I use the GitHub web interface and the git cli. Answers for either or\nboth are appreciated.\n\nSometimes, when I merge a branch into another branch, I see a commit\nwith a message like \"Merge branch 'master' into other_branch\" in the\nGitHub history. But not always. So how do I see all \"merge events\",\ninside the history?\n\nEven better if I can get a view with vertical lines showing branches\nand merges (like a graph).\n"},{"id":"320555","messageId":"20170523122046.xfxudxqof726vzuj@sigill.intra.peff.net","threadId":"46033","inReplyTo":"CAJtFkWu25RkiKm0O__W2My+Adi9pxZ3YtjZW4eb+2U+wpNS3yA@mail.gmail.com","subject":"Re: How do I see “merge events” in history?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-05-23T12:20:46Z","receivedAt":"2017-05-23T12:20:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, May 23, 2017 at 03:07:40PM +0300, Stefan Monov wrote:\n\n> I use the GitHub web interface and the git cli. Answers for either or\n> both are appreciated.\n> \n> Sometimes, when I merge a branch into another branch, I see a commit\n> with a message like \"Merge branch 'master' into other_branch\" in the\n> GitHub history. But not always. So how do I see all \"merge events\",\n> inside the history?\n\nThe simple answer is that to see all merges, you can run \"git log\n--merges\". But I think that's not quite what you're asking.\n\nYour \"but not always\" makes me think you are wondering why sometimes\nwhen you run \"git merge\" (or \"git pull), it results in a merge commit\nand sometimes not, and whether you can see evidence of the times when it\nwas \"not\".\n\nWhen a merge is a \"fast forward\", i.e., when the thing you are merging\nis strictly a descendent of your current branch, then Git omits the\nmerge commit and simply updates your current branch tip to the thing\nyou're merging. This can happen if you forked a branch, and then when it\ncame time to merge it back, nothing had happened on the original branch.\n\nIn a fast forward merge, there's no evidence at all of the merge command\nin the resulting history graph. So there's nothing to find via \"git\nlog\".\n\nFor some workflows you'd rather see a commit for such merges, even if it\ncould fast-forward. For example, when merging a topic branch, you may\nwant the graph to reflect that the work was done on a side branch, even\nif nothing happened on \"master\" in the interim. You can use \"git merge\n--no-ff\" for this.\n\n> Even better if I can get a view with vertical lines showing branches\n> and merges (like a graph).\n\nTry \"git log --oneline --decorate --graph\". It will show you the graph\nstructure and annotate the tips of any branches.\n\n-Peff\n"}]}