Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find first commit specific to a branch

Tags:

git

branch

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?

like image 700
warpc Avatar asked Jul 13 '11 08:07

warpc


People also ask

How do I find my first commit?

Click on the "Insights" tab of the repository that you want to see the oldest commit, followed by the "Network" sub-tab on the left menu bar. When the page is fully loaded (i.e. you can see lots of lines joining and all), press Shift + ← to go all the way to the first commit.

How do you check the commit belongs to which branch?

Using --all --source is close, but will only display one of the branches for each commit. However, if you click on a commit in gitk --all , you'll see that it lists every branch that that commit is on.

How do I see the commit history of a branch?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.

How do I find a specific commit in git?

If you have the hash for a commit, you can use the git show command to display the changes for that single commit. The output is identical to each individual commit when using git log -p .


1 Answers

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

like image 67
softarn Avatar answered Sep 23 '22 10:09

softarn