Comments (2)
Hey,
I'm not sure of a good way to go about doing this in an efficient way. You probably want to use git rev-list A..B --not --remotes=dest
(where dest
is the destination remote), which will make this a lot more efficient and avoid traversing all objects that are already on the destination, but it's still not going to be screamingly performant.
We internally use git cat-file --batch
to make it more efficient to find the objects without spawning a large number of Git processes, which you can do, too. You can also use git cat-file --batch-check
first to find those items which are pointer files (which must be less than 1024 bytes), since sometimes people mark a file as an LFS file and then push the large object anyway. However, this will likely require more work than a simple shell one-liner, so you might want to write something like a Ruby script to handle this.
I think what you want here for scripting is an equivalent to git lfs push
's --object-id
flag, which unfortunately doesn't exist yet. It shouldn't be too hard to add if you're interested, but it's ultimately going to be rather difficult to handle as part of scripting without adding that functionality.
from git-lfs.
Yeah, I ended up solving this using a Python script which did something along the lines of my original post, except that rather than passing revisions to git lfs fetch
, it was easier to directly pipe LFS pointer file content to git lfs smudge
(discarding the output, but taking advantage of the fact that it caused the object to be downloaded).
And yes, supporting --object-id
for git lfs fetch
would be nice and would avoid needing to do the smudge shenanigans. Ideally LFS would expose facilities for synchronizing remote/local LFS object stores without needing to touch commits - push --object-id
is half of that story, but we're missing a corresponding fetch
piece.
from git-lfs.
Related Issues (20)
- Doesn't work in Windows 7 HOT 4
- git lfs ls-files --all -ls should print out exact size HOT 2
- .blend file size appears to increase during git lfs upload before failing. Actual file remains unchanged, fails to push. HOT 1
- Add ability to bypass .lfsconfig in git-lfs-filter-process, git-lfs-filter-clean and git-lfs-filter-smudge HOT 2
- Impossible to control git-lfs setup on git clone process. HOT 2
- filter-process initialization: strconv.ParseInt: parsing "\ufeff0": invalid syntax HOT 2
- GitHub knows my public key but I can't use LFS, why? HOT 2
- Git push rejected due to binary files despite already installing git lfs and tracking the file HOT 3
- Can't untrack large file, and push it to github. HOT 7
- error: external filter 'git-lfs filter-process' failed HOT 1
- git lfs filee not showing after pushing HOT 2
- error: could not lock config file HOT 5
- git add adds file to LFS even when file does not match the LFS filter HOT 7
- How to get the actual file content or directory HOT 13
- Make hostname reverse lookup optional for Kerberos authentication
- LFS: Client error with HTTP 413 HOT 1
- Fetching all refs and tags on every push can be really slow for large repositories HOT 4
- Git LFS over HTTPS Blocked by Fortinet IPS due to Basic Authorization Overflow HOT 8
- git-lfs 3.5.1 has CVE-2024-24790 because it seems that it's using GO 1.21.7 HOT 4
- File not marked as read-only when unlocked while open during file locking HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-lfs.