{"thread":{"id":"22886","subject":"Identifying the branch a clone was cloned from","startedAt":"2010-03-02T21:45:58Z","lastAt":"2010-03-02T23:15:30Z","messageCount":2,"participants":["jateeq","Santi Béjar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"136042","messageId":"27761617.post@talk.nabble.com","threadId":"22886","inReplyTo":null,"subject":"Identifying the branch a clone was cloned from","fromName":"jateeq","fromEmail":"jawad_atiq@hotmail.com","sentAt":"2010-03-02T21:45:58Z","receivedAt":"2010-03-02T21:45:58Z","isPatch":false,"sender":{"key":"jawad_atiq@hotmail.com","avatar":null},"body":"\nHey guys,\n\nI have a repository with over 10 branches. I clone from branch 2, and some\ntime after the operation I need to find out what branch in the remote I\ncloned from. Anyone know the command for that?\n\nThank you,\nJawad.\n-- \nView this message in context: http://old.nabble.com/Identifying-the-branch-a-clone-was-cloned-from-tp27761617p27761617.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"136045","messageId":"adf1fd3d1003021515t765b8acawa28196693da21681@mail.gmail.com","threadId":"22886","inReplyTo":"27761617.post@talk.nabble.com","subject":"Re: Identifying the branch a clone was cloned from","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2010-03-02T23:15:30Z","receivedAt":"2010-03-02T23:15:30Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Tue, Mar 2, 2010 at 10:45 PM, jateeq <jawad_atiq@hotmail.com> wrote:\n>\n> Hey guys,\n>\n> I have a repository with over 10 branches. I clone from branch 2, and some\n> time after the operation I need to find out what branch in the remote I\n> cloned from. Anyone know the command for that?\n\nIf you mean from which branch you forked a given branch it is\nspecified in the branch.<name>.remote and branch.<name>.merge + some\nlogic. To get it you can use the branchname@{upstream} syntax (new in\n1.7.0) or use this command:\n\ngit for-each-ref --format='%(upstream)' refs/heads/branchname\n\nBut maybe we can help more if you say what you want to accomplish with\nthis information and not this specific detail.\n\nHTH,\nSanti\n"}]}