Coder Social home page Coder Social logo

Comments (4)

bk2204 avatar bk2204 commented on June 9, 2024

Hey,

I'm not sure what your goal is. git add will in fact write multiple files if you specify them on the command line, but I don't believe it's multithreaded. If you want a multithreaded approach and you just need the files in the LFS storage (and not the Git index), you can pipe each file to git lfs clean and you can run several threads of that. However, if you run git add on the file again, then it will be cleaned again, because without git add you haven't recorded the large files in the index.

If you tell us a bit more about what your goal is, we'd be able to better help you achieve it.

from git-lfs.

lucashaha avatar lucashaha commented on June 9, 2024

when I use git add,.git/lfs/ increase just one at one time,is it possible to add multiple file in .git/lfs/tmp and .git/lfs/objects?
image
image
image
image
image

from git-lfs.

bk2204 avatar bk2204 commented on June 9, 2024

As I mentioned above, it is possible to add them to the Git LFS storage by doing something like so (assuming the list of files is in the file FILES and you want to run 8 at a time):

$ cat FILES | xargs -P8 -L1 sh -c 'git lfs clean < "$0"'

However, that won't add them to the index, so if you want to actually commit those objects, you'll need to use git add, which isn't multithreaded. You're welcome to request that parallel git add be implemented on the Git mailing list or send a patch yourself.

It is possible to combine git lfs clean, git hash-object -t blob, and then a single git update-index call to do it in parallel, but you'll need to do a decent amount of scripting to do that.

from git-lfs.

bk2204 avatar bk2204 commented on June 9, 2024

Here's another way you could do things in parallel that might be easier:

$ cat FILES | xargs -P8 -L1 sh -c 'printf '\''100644 %s\t%s\0'\'' $(git hash-object -t blob "$0") "$0"' | git update-index -z --add --index-info

This would work just like git add in that it would add the files to the index, which might be what you want. It would also run in parallel.

from git-lfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.