Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Created December 2, 2016 04:11
Show Gist options
  • Save zulhfreelancer/41eac7d775c3c5c57d07d6b1b7f4c21e to your computer and use it in GitHub Desktop.
Save zulhfreelancer/41eac7d775c3c5c57d07d6b1b7f4c21e to your computer and use it in GitHub Desktop.
How to find the first commit in a Git branch?
$ git log <source_branch>..<feature_branch> --oneline | tail -1

Reference

@HaleTom
Copy link

HaleTom commented Oct 12, 2018

You could also use --reverse and then head -n1 for pathologically long lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment