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

shallow&single-branch clone?

From
NNNorbert Nemec <norbert.nemec@native-instruments.de>
Date
Oct 19, 2011, 13:30 UTC
Message-ID
<4E9ED108.5020505@native-instruments.de>
Hi there,

it seems like there is no way to clone a single branch with truncated history.

Truncating history is done by 'git clone --depth 1', there is not way to restrict 'clone' to a single branch (the --branch option still downloads all branches and only then chooses something other than HEAD as active branch).

The manual sequence
	git init
	git remote add -t master -f origin URL
	git checkout
allows a clone of a single branch but offers no means to truncate history.

The least intrusive solution would be an additional option to clone, perhaps '--branch-only'.

More user friendly, this options should be on by default when --depth is set. After all: who would expect branches to be cloned when the history is explicitely truncated?

Ideas?

Greetings, Norbert Nemec

Next: Jeff King
Message 1 of 2 in “shallow&single-branch clone?”
  1. Norbert NemecOct 19, 2011
  2. Jeff KingOct 21, 2011

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.