Re: Find the starting point of a local branch
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 24, 2012, 05:28 UTC
- Message-ID
- <CACsJy8CNd3W_WUMbZ1QZ4ReZ5ziX90QejK9mh1TMs0ig33kGMw@mail.gmail.com>
- In-Reply-To
- <201212240409.qBO49wkV020768@no.baka.org>
On Mon, Dec 24, 2012 at 11:09 AM, Seth Robertson <in-gitvger@baka.org> wrote:
Show 17 quoted lines
> > In message <20121224035825.GA17203@zuhnb712>, Woody Wu writes: > > How can I find out what's the staring reference point (a commit number > or tag name) of a locally created branch? I can use gitk to find out it > but this method is slow, I think there might be a command line to do it > quickly. > > The answer is more complex than you probably suspected. > > Technically, `git log --oneline mybranch | tail -n 1` will tell you > the starting point of any branch. But...I'm sure that isn't what you > want to know. > > You want to know "what commit was I at when I typed `git branch > mybranch`"? The problem is git doesn't record this information and > doesn't have the slightest clue.
Maybe we should store this information. reflog is a perfect place for this, I think. If this information is reliably available, git rebase can be told to "rebase my whole branch" instead of my choosing the base commit for it.
-- Duy