On Mar 17, 4:40 pm, jayman <jawad.a...@gmail.com> wrote: > I am trying to find the time at which a remote branch was created, so > that I can use the '--since' option in git log to limit the commits to > only ones that were created for that branch (read below to see why I > can't use 'git log <branchnname>). So my question: does git remember > the time at which a branch was created, and how can it be listed?
Impossible. A branch is merely a file which has the name of the tip commit written into it. > NOTE: Once I clone a repository that contains Branch1 (which will have > its own commits as well as commits from the master branch), I create > Branch2 in the clone to track Branch1. Branch1 will have commits > before the cloning, and Branch2 will have its own commits after the > cloning, but I want to list both. The way I am thinking of doing it is > to list all commits for Branch2, and then limit the commits to only > ones that were created after Branch1 was created. Unfortunately, I failed to reliably parse this, so I'll make two guesses: 1) You have a branch "Branch2" which has been forked from "Branch1" and accumulated several commits since then, and you want to see all the commits made on Branch2 but not those made on Branch1 before the fork. You then need $ git log Branch2 ^Branch1 in this case. Or, alternatively, $ git log Branch1..Branch2 See the "SPECIFYING REVISIONS" section of the git-rev-parse manual. 2) You have a branch "Branch2" which has been forked from "Branch1" and accumulated several commits since then, and you want to see everything on Branch2, including commits on Branch1, but only until the commit which was at the top of Branch1 at the time you cloned the repo. You then need to tag your branch immediately after cloning the repo to make a "persistent pointer" to that branch's tip commit at the time of cloning. You will then be able to use that tag to set the limit for `git log` (see the first case above on how to limit). -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.