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

Pushing/fetching from/into a shallow-cloned repository

From
KKKonstantin Khomoutov <kostix+git@007spb.ru>
Date
Apr 18, 2013, 09:52 UTC
Message-ID
<20130418135233.87aa23896fa48dc2d87d80fb@domain007.com>

The git-clone manual page, both [1] and my local copy coming with Git for Windows 1.8.1, say about the --depth command-line option:

   --depth <depth>
     Create a shallow clone with a history truncated to the specified
     number of revisions. A shallow repository has a number of
     limitations (you cannot clone or fetch from it, nor push from nor
     into it), but is adequate if you are only interested in the recent
     history of a large project with a long history, and would want to
     send in fixes as patches.

But having done a shallow clone (--depth=1) of one of my repositories, I was able to record a new commit, push it out to a "reference" bare repository and then fetch back to another clone of the same repository just fine. I have then killed my test commit doing a forced push from another clone and subsequently was able to do `git fetch` in my shallow clone just fine.

So I observe pushing/fetching works OK at least for a simple case like this one.

Hence I'd like to ask: if the manual page is wrong or I'm observing some corner case?

Next: Konstantin Khomoutov
Message 1 of 6 in “Pushing/fetching from/into a shallow-cloned repository”
  1. Konstantin KhomoutovApr 18, 2013
  2. Konstantin KhomoutovApr 18, 2013
  3. Philip OakleyApr 18, 2013
  4. Junio C HamanoApr 18, 2013
  5. Konstantin KhomoutovApr 19, 2013
  6. Duy NguyenApr 19, 2013

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.