From: Nguyen Thai Ngoc Duy Date: Mon, 24 Dec 2012 05:28:45 GMT Subject: Re: Find the starting point of a local branch Message-ID: In-Reply-To: <201212240409.qBO49wkV020768@no.baka.org> On Mon, Dec 24, 2012 at 11:09 AM, Seth Robertson wrote: > > 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