Reference Git branch start commit

I am trying to find how to reference branch start commit from script. I mean the commit sha at which branch was forked.

Moreover I expect it work for history made from svn repo.

  • How to configure Git post commit hook
  • Keep a commit locally to clone in Git
  • Git remove root commit
  • Github Commit Syntax to Link a Pull Request/ Issue
  • Moving all commits beyond initial commit off master
  • Lost Last Git Commit
  • This post just gives first commit of repo creation and not feature branch start commit.

  • get changes newer than a given revision with git show
  • How to fix “address space is already occupied” error on fetch/commit?
  • Stopping a git gc --aggressive, is that a bad thing?
  • git synchronization of rebased branches
  • How to view files in bare repositories?
  • Accessing a git repository via ssh behind a firewall
  • One Solution collect form web for “Reference Git branch start commit”

    What you’re looking for is the command merge-base:

    git merge-base master feature-branch

    will print the best common ancestor of those two branches, i.e. where they forked apart. (The documentation has pretty pretty pictures to clarify some of the interesting cases)

    Git Baby is a git and github fan, let's start git clone.