Hi Vinod, I did what you said but the thing is my working directory still contains trunk branch !! what i see for example as branch-1.2 is different from branch-2 . I switch to branch-1.2 like "git checkout remotes/origin/branch-1.2" and it contains for example build ,bin ,conf, lib, source ,logs directories .. but when i switched to branch-2 it still shows trunk . I tried with what you suggested "git checkout -b branch-2 origin/branch-2" .a new branch called branch-2 is added but still contains trunk !!!!
I am wondering why "git checkout remotes/origin/branch-1.2" switched to branch-1.2 but "git checkout remotes/origin/branch-2" not switching to branch-2 !!!! If you try with "git checkout -b branch-2 origin/branch-2" , do you see branch-2 contents in your working directory ? Samaneh On Mon, Apr 29, 2013 at 2:10 AM, Vinod Kumar Vavilapalli < vino...@hortonworks.com> wrote: > > Right, you have to do "git checkout -b branch-2 origin/branch-2". You get > the trunk branch by default, for all other remote branches, you have to > create local branches like that. > > HTH > > Thanks, > +Vinod Kumar Vavilapalli > Hortonworks Inc. > http://hortonworks.com/ > > > On Apr 28, 2013, at 12:42 PM, Samaneh Shokuhi wrote: > > > Hi Vinod, > > i tried with the path you sent but no success .I mean is it not really > > switched to branch-2 ,and calling the "git branch -a" displays "no > branch" > > .Working directory still contains trunk not branch-2 contents. what i > get > > in console is : > > > > You are in 'detached HEAD' state. You can look around, make experimental > > changes and commit them, and you can discard any commits you make in this > > state without impacting any branches by performing another checkout. > > > > If you want to create a new branch to retain commits you create, you may > > do so (now or later) by using -b with the checkout command again. > Example: > > > > git checkout -b new_branch_name > > > > HEAD is now at 72713e0... HDFS-4748. Merge r1476587 from trunk. > > > > > > > > On Sun, Apr 28, 2013 at 9:20 PM, Vinod Kumar Vavilapalli < > > vino...@hortonworks.com> wrote: > > > >> > >> Not sure about how updated the repo at github is, I use git:// > >> git.apache.org/hadoop-common.git > >> > >> Also what do you mean by branch switch is not working? > >> > >> Thanks, > >> +Vinod > >> > >> On Apr 28, 2013, at 11:45 AM, Samaneh Shokuhi wrote: > >> > >>> Hi All, > >>> i ve got a clone of hadoop and tried to switch to branch-2 but ,it is > not > >>> working ,while switching to other branches like branch-1.2 is possible. > >> Any > >>> idea why cant switch to branch-2 ? > >>> > >>> That’s what i ve done : > >>> > >>> $ git clone git://github.com/apache/hadoop-common.git hadoop-1 > >>> $ cd hadoop-1 > >>> $ git checkout remotes/origin/branch-2 > >>> > >>> > >>> Samaneh > >> > >> > >