Re: Git commit causes data download in partial clone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff thank you for taking a look at this.

On Tuesday, February 20th, 2024 at 3:43 AM, Jeff King <peff@xxxxxxxx> 
wrote:

> a. Your --no-checkout skips the checkout, but it does not tell Git
> that you are fundamentally uninterested in those other paths. To do
> that, you can try the sparse-checkout mechanism. I'm not super
> familiar with the feature myself, but doing:
> 
> git clone --sparse --filter=blob:none $url nes

That's it! Now git knows exactly what I want from it. I am now able 
to add and commit new files and git status no longer lists any deleted 
paths. Also I can search for files I actually need with "git ls-files" 
and add them to the sparse checkout incrementally with "git 
sparse-checkout add". I haven't explored this feature before because 
because I assumed it is limited to selecting entire directory 
subtrees not individual files which would not help with the 
mentioned repo.

> Do note that --sparse checks out the contents of the top-level tree
> by default. That's OK for your repo (all of the files are in the
> Named_Titles directory), but it might not be true for some other
> repos (it may also not work if your intent is to put another entry
> into Named_Titles, though it looks like you might just need to say
> "git add --sparse").

I think this could be avoided by cloning with --no-checkout, 
creating index with "git reset" and setting up empty sparse 
checkout afterwards with "git sparse-checkout set /".

Anyway it seems like with these tools I'm finally ready to tackle any 
huge git repo they throw at me in the future :)







[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux