{"thread":{"id":"22443","subject":"is there a way to reference the branch point?","startedAt":"2010-01-29T22:29:17Z","lastAt":"2010-02-03T21:40:59Z","messageCount":3,"participants":["layer","Sverre Rabbelier"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"133026","messageId":"18219.1264804157@relay.known.net","threadId":"22443","inReplyTo":null,"subject":"is there a way to reference the branch point?","fromName":"layer","fromEmail":"layer@known.net","sentAt":"2010-01-29T22:29:17Z","receivedAt":"2010-01-29T22:29:17Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"If I make a branch `foo' off master, commit a bunch of times, is there\na way to reference the place on master from which I branched?\n\nThanks.\n\nKevin\n"},{"id":"133030","messageId":"fabb9a1e1001291435p59599f62hd54cbca66d91c24b@mail.gmail.com","threadId":"22443","inReplyTo":"18219.1264804157@relay.known.net","subject":"Re: is there a way to reference the branch point?","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-01-29T22:35:18Z","receivedAt":"2010-01-29T22:35:18Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Fri, Jan 29, 2010 at 23:29, layer <layer@known.net> wrote:\n> If I make a branch `foo' off master, commit a bunch of times, is there\n> a way to reference the place on master from which I branched?\n\nDepends, if you make a new branch from master, you can use 'git merge-base', so:\n\n$ # on master\n$ git checkout -b foo-topic-branch\n$ # work work\n$ git commit\n$ # work work\n$ git commit\n\nNow you want to know where you branches off from master:\n\n$ git merge-base foo-topic-branch master\n\nThat will show you the commit you branches off from, even if master\nhas grown new commits since then.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"133540","messageId":"8481.1265233259@relay.known.net","threadId":"22443","inReplyTo":"fabb9a1e1001291435p59599f62hd54cbca66d91c24b@mail.gmail.com","subject":"Re: is there a way to reference the branch point?","fromName":"layer","fromEmail":"layer@known.net","sentAt":"2010-02-03T21:40:59Z","receivedAt":"2010-02-03T21:40:59Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"Sverre Rabbelier <srabbelier@gmail.com> wrote:\n\n>> Heya,\n>> \n>> On Fri, Jan 29, 2010 at 23:29, layer <layer@known.net> wrote:\n>> > If I make a branch `foo' off master, commit a bunch of times, is there\n>> > a way to reference the place on master from which I branched?\n>> \n>> Depends, if you make a new branch from master, you can use 'git\n>> merge-base', so:\n>> \n>> $ # on master\n>> $ git checkout -b foo-topic-branch\n>> $ # work work\n>> $ git commit\n>> $ # work work\n>> $ git commit\n>> \n>> Now you want to know where you branches off from master:\n>> \n>> $ git merge-base foo-topic-branch master\n>> \n>> That will show you the commit you branches off from, even if master\n>> has grown new commits since then.\n\nThat works, but what if I don't know it's off master?  Normally, a\nhuman would, but what if this is a script I'm writing?\n\nThanks.\n\nKevin\n"}]}