On Monday 23 April 2007, Carl Worth wrote: > On Thu, 19 Apr 2007 13:57:35 -0700 (PDT), Linus Torvalds wrote: > > - Case #1 would be using git basically as a "anonymous CVS" replacement > > to track somebody others project. > > I'd extend this to also say "tracking a specific branch" in some > project. > > When I raised this recently, Junio suggested something like the > following: > > git config --global branch.autosetupmerge true [*] > git clone <URL> > git checkout -b <branch> origin/<branch> > git pull > > I haven't gotten around to replying to that message yet, but the > thrust of my reply would be that that does actually work, but it's not > even close to the ease with which one can track the default branch as > Linus described: The commands above are not needed for pure tracking, but instead prepare a local development branch for you to work on, and where you can pull upstream changes with "git pull". For tracking a remote $branch, it should be enough to do git clone git fetch and you get the any (*) remote $branch as "remotes/origin/$branch". Josef (*) Perhaps the "any" is too much for wanting to track one branch only? > > > None of the above are ever really needed for that case, and I think all > > you really want to learn is: > > > > git clone > > git pull > > So, currently, all non-default branches have a sort of second-class > status from the point of view of users that just want to track > them. > > Compare this to svn, for example. Now, svn has an insanely broken > model for what a branch actually is, while git's model is sane. But I > think that with svn the "anonymously tracking a branch" use case isn't > any harder for any one branch compared to any other, (it's just a > matter of starting with the right URL). I'd love to see git achieve > the same thing. > > -Carl > > [*] Is the command I have above even correct? What Junio actually > suggested was: > > $ cat >>$HOME/.gitconfig <<\EOF > [branch] > autosetupmerge > EOF > > But I can't find a way to use git-config create a block that looks > like that. I'm just guessing that "autosetupmerge = true" works > equivalently, but I could be wildly wrong. > - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html