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

Re: does clone --depth work?

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Nov 29, 2009, 16:32 UTC
Message-ID
<20091129163242.GA7921@atjola.homenet>
In-Reply-To
<20091129160352.GO10640@bicker>
On 2009.11.29 18:03:52 +0200, Dan Carpenter wrote:
Show 6 quoted lines
> I do: `git clone --depth 0 ./repo1/ repo2`  I expected that 
> "git log" in repo2 wouldn't show any revisions, but it does.
> 
> I'm using 1.6.5.3.171.ge36e.dirty (small unrelated modification).
> 
> Am I doing something incorrectly?

Two problems: a) IIRC depth = 0 is like not specifying depth at all b) When using plain paths, clone optimizes the process by just doing a copy, that doesn't apply the depth setting at all

git clone --depth=1 file://$PWD/repo1 repo2

That should work. Of course you still got some commits, so "git log" will show them. You just don't get all of them, but only to a certain depth.

Björn
Previous: Dan CarpenterNext: Dan Carpenter
Message 2 of 3 in “does clone --depth work?”
  1. Dan CarpenterNov 29, 2009
  2. Björn SteinbrinkNov 29, 2009
  3. Dan CarpenterNov 30, 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.