July 2009 Archives

This is one of my own personal Git FAQs. Here's the scenario: You've created a topic branch of new code, and done all the work required to complete the feature. But before you can merge it back into the main tree, you get assigned to some new work, and the branch sits dormant for several days. Now the time has come to merge that feature back in, but it's been so long, you forgot exactly what the code included. Does it conflict with anything new? Was part of the problem solved with some later code? Here's how you find out:


git co development # The destination branch
git diff HEAD...topic-branch

You've probably guessed that the magic there is the .... In English, that symbol means show the difference between the common ancestor commit and HEAD.... in other words, only show what changes in the topic branch while it was distinct from the branch it's being merged into.

Who's this guy?

Aaron Longwell is Chief Web Craftsman at New Media Logic Corporation in Portland, Oregon. A professional software developer for 14 years, he occasionally has interesting things to say about software, technology, culture and politics.

Subscribe to feed Subscribe to my RSS Feed

  • View Aaron Longwell's profile on LinkedIn
  • Recommend Me