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

[PATCH] git-clone -s: document problems with git gc --prune

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jan 22, 2008, 21:03 UTC
Message-ID
<20080122210305.GM4475@genesis.frugalware.org>

There is a scenario when using git clone -s and git gc --prune togother is dangerous. Document this.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

I see people on #git regularly who do not know about this option can cause problems, so I think it's important to document this.

 Documentation/git-clone.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index fdccbd4..5c4d936 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -62,6 +62,12 @@ OPTIONS
 	.git/objects/info/alternates to share the objects
 	with the source repository.  The resulting repository
 	starts out without any object of its own.
+	*NOTE*: this is a possibly dangerous operation; do *not* use
+	it unless you understand what it does. If you clone your
+	repository using this option, you delete branches in the
+	source repository and you run linkgit:git-gc[1] using the
+	`--prune` option, then it will remove objects which are
+	referenced ones in the target repository!
 
 --reference <repository>::
 	If the reference repository is on the local machine
-- 
1.5.4.rc3.4.g16335-dirty
Next: Brandon Casey
Message 1 of 3 in “git-clone -s: document problems with git gc --prune”
  1. git-clone -s: document problems with git gc --pruneMiklos Vajna, Jan 22, 2008
  2. Brandon CaseyJan 22, 2008
  3. git-clone -s: document problems with git gc --pruneMiklos Vajna, Jan 22, 2008

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.