{"thread":{"id":"2507","subject":"[RFC] Not grabbing ALL branches and tags with git clone","startedAt":"2005-11-14T18:26:16Z","lastAt":"2005-11-14T21:01:13Z","messageCount":2,"participants":["Carl Baldwin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"11824","messageId":"20051114182616.GB19105@hpsvcnb.fc.hp.com","threadId":"2507","inReplyTo":null,"subject":"[RFC] Not grabbing ALL branches and tags with git clone","fromName":"Carl Baldwin","fromEmail":"cnb@fc.hp.com","sentAt":"2005-11-14T18:26:16Z","receivedAt":"2005-11-14T18:26:16Z","isPatch":false,"sender":{"key":"cnb@fc.hp.com","avatar":null},"body":"Greetings,\n\nLately, I've found that 'git clone' gives me more than what I want.\nEspecially when there are a lot of branches and tags in the remote\nrepository.\n\nI have found myself doing something like the following in most cases.\n\n% mkdir work && cd work\n% git init-db\n% git fetch <url> <refspec>\n% git checkout -f -b master <branch>\n\nUsually, I will use a file in .git/remotes but you get the idea.  I was\nthinking that it might make sense to make git clone able to do this.\nChange the usage of git clone so that it looks like this:\n\ngit clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> <dir> [<refspec>] ...\n\ngit clone would behave exactly the same way if no refspec were given but\nif a refspec (or multiple refspecs) were given on the command line then\ngit clone would behave more like my series of three commands above.\n\nI haven't looked at what it would take to patch git clone for this\npurpose.  Just wanted to see what you thought.\n\nCheers,\nCarl\n\n-- \n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n Carl Baldwin                        Systems VLSI Laboratory\n Hewlett Packard Company\n MS 88                               work: 970 898-1523\n 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com\n Fort Collins, CO 80525              home: Carl@ecBaldwin.net\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"},{"id":"11839","messageId":"7v7jbbx7ty.fsf@assigned-by-dhcp.cox.net","threadId":"2507","inReplyTo":"20051114182616.GB19105@hpsvcnb.fc.hp.com","subject":"Re: [RFC] Not grabbing ALL branches and tags with git clone","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-14T21:01:13Z","receivedAt":"2005-11-14T21:01:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carl Baldwin <cnb@fc.hp.com> writes:\n\n> Lately, I've found that 'git clone' gives me more than what I want.\n> Especially when there are a lot of branches and tags in the remote\n> repository.\n\nWhen I make a clone of git.git, oftentimes the first thing I do\nis:\n\n\t$ git branch -D todo\n\nBut I've always considered that a rare exception (i.e. the todo\nbranch is not related to the main source).  What kind of\nunrelated things do you keep in a single repository such that\nyou do not want to start out in sync with all of its branches?\n"}]}