git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: clone

From
Jeff King <peff@peff.net>
Date
Jul 20, 2009, 15:24 UTC
Message-ID
<20090720152407.GC5347@coredump.intra.peff.net>
In-Reply-To
<D229D90E-0294-475D-B7AC-6C7B23CC169A@roalddevries.nl>
On Mon, Jul 20, 2009 at 04:33:51PM +0200, Roald de Vries wrote:
Show 5 quoted lines
> If I clone a repository with multiple branches to 'newdir', and then
> type 'git branch' in 'newdir', I see only 1 branch. 'git branch -r'
> gives me all branches. Is that correct behaviour? If so, why? And
> mainly: can I configure git to clone all original branches to non-
> remote branches?

Yes, it's correct. You really only need local branches of things you are going to work on. And then that happens, you generally would just "git checkout -b foo origin/foo" to make your own local "foo" branch that you will be working on (or if you are using topic branches, something more like "git checkout -b mytopic origin/master"). If you are just inspecting branches (e.g., checking them out to try building, doing diffs against them, using them as reference points for logging, etc), then the remote versions are fine.

-Peff
Previous: Roald de VriesNext: Michael J Gruber
Message 2 of 4 in “clone”
  1. Roald de VriesJul 20, 2009
  2. Jeff KingJul 20, 2009
  3. Michael J GruberJul 21, 2009
  4. Roald de VriesJul 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.