6

Looking for commits A(master), C(0.1), K(0.1.1) and O(0.2).

A - B - D - F - G   <- "master" branch (at G)
 \   \        
  \   C - E --M     <- "0.1" branch (still at E)
   \       \
    \       K - L   <- "0.1.1" branch (still at L)
     \
      O - P - F     <- "0.2" branch (still at F)

How can detect this commits by scripts without user data about parent branch. In other words, how to determine the first commit (A, O, C, K), belongs to a particular branch, knowing only the name of this branch?

CharlesB
  • 86,532
  • 28
  • 194
  • 218
warpc
  • 221
  • 2
  • 5
  • possible duplicate of [In git, how can I find the revision at which a branch was created?](http://stackoverflow.com/questions/6058308/in-git-how-can-i-find-the-revision-at-which-a-branch-was-created) – CharlesB Jul 13 '11 at 13:02

2 Answers2

3

Try

git log master..0.1

I think it should display commit C, E and M(is that a commit?)

Edit: The above works only if you have info about the parent branch.

New answer is to try the tool gitk

softarn
  • 5,327
  • 3
  • 40
  • 54
  • I need A, C, K and O. And i only know one branch and it will be in program, i can't use master..0.1, because program don't know, that branch are parent for current. – warpc Jul 13 '11 at 10:43
0

Try this to get the hash of first commit:

git log <source_branch>..<feature_branch> --pretty=format:%h

user
  • 867
  • 9
  • 21