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

Re: Can you git clone -partial? I am looking to make a mobile app and it would be nice to have.

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 1, 2014, 17:38 UTC
Message-ID
<xmqqtx3npu6e.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAOHoyPr3E9U3XPEjmrSNkT0okHcRN2H7OKyrt-Ar3WMMDL=4vw@mail.gmail.com>
James Hancock <james@bookstobrains.com> writes:
Show 14 quoted lines
> i am thinking about developing an app and I want to integrate it with
> git but I only want to store a portion of the file on disk. It is
> going to be in a mobile enviornment and I want to just get one file or
> a small group of files.
>
> I read that you can clone and then only look at one peice but is it
> possible just to clone one peice? And if not what would it take? Maybe
> this is a feature people would like to have. Just hypothetically, what
> would need to happen?
>
> Either
> git clonepartial /repo /file/or/folder/in/repo
> Or
> Git clone -partial /repo /file/or/folder/in/repo

You keep saying "file", but the thing is, Git does not track file. It tracks history of collection of files.

What are you trying to achieve, exactly? What does your "app" need out of that operation? Does it need these selected files with their history? Or does it only care about the contents of the selected files at the tip of the 'master' branch of that repository?

I'd imagine that your answer would be the latter, and suspect that you may want to run "git archive --remote" with a pathspec to limit what gets grabbed.

Previous: James HancockNext: James Hancock
Message 2 of 3 in “Can you git clone -partial? I am looking to make a mobile app and it would be nice to have.”
  1. James HancockOct 1, 2014
  2. Junio C HamanoOct 1, 2014
  3. James HancockOct 1, 2014

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.