![]() ![]() There are some smart people who say you should never have merge commits, and some other smart people who do lots of merge commits. There are a million blog posts about that already. This post is long enough as it is, so I don’t want to use space in this blog post to discuss when to rebase and when to merge. If it is you, please try to hold your breath until the end of this section. Not you, dear reader, but I think we all know who it is I’m talking about. Yes, I know what a rebase is: a defensive disclaimerīefore I continue, I should point out that Git makes it possible to eliminate merge commits with git rebase, and somebody’s going to read this post and run to Hacker News to say how stupid I am, because you should only use git rebase and you should never have merge commits. In troubled times like these, Git wizards can use advanced git log parameters to cast Magic Missile at the darkness. (“OMG I messed up my merge and now everything’s broken!!!1!!”) In my experience at Redfin, developers frequently reach out to a local Git expert when they have a confusing experience with a Git merge. In those cases, -no-merges may yield better results.īy the time I’m done, I hope not only to teach you about a few useful parameters to git log, but to deepen your understanding of Git as a whole. I’ll end by giving an example where -first-parent doesn’t do what you’d want. ![]() Git visualize branches how to#Then I’ll show how you can visualize Git merge history using git log -graph, and how to see the “true” history of a single branch using -first-parent. I’ll start by showing how the default “chronological” order of git log can mislead you when the history contains merge commits. ![]() In this post, I’ll walk you through a few parameters that can help clear things up. Git log can display surprisingly confusing results when the history contains merges. Git merges can be complicated, but these arcane parameters can help.ĭan Fabulich is a Principal Engineer at Redfin. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |