From: Tomas Carnecky Date: Mon, 24 Dec 2012 05:34:51 GMT Subject: Re: Find the starting point of a local branch Message-ID: <1356327291-ner-6552@calvin> In-Reply-To: On Mon, 24 Dec 2012 12:28:45 +0700, Nguyen Thai Ngoc Duy wrote: > 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. What's the starting point of the branch if I type: git branch foo ?