Comments (1)
Hey, I'm sorry you're having trouble. You've posed a few questions, so I'll try to answer them, but not all in the original order.
Is there a way of cloning a LFS repo with only the pointers, and then at a later stage do
git lfs checkout
in order to get the large files?
Yes, you can use the GIT_LFS_SKIP_SMUDGE=1
environment variable to control whether the Git LFS client "smudges" when you clone (i.e., replaces pointer files with object contents). Then you can run git lfs checkout
as needed.
How do i prune and clear the git objects?
I think what you may be noticing here, after running git lfs prune -f
, is that files in your working tree which correspond to Git LFS pointer files in the repository still have the full Git LFS object contents, so you're seeing a *
in the git lfs ls-files
output. That's expected, because what git lfs prune
manages is the Git LFS local cache under .git/lfs/objects
, not the files in your working tree. I suspect that if you run find .git/lfs/objects -type f
before and after git lfs prune
you'll see the cached object files have been removed.
Note too in particular that .git/lfs/objects
is distinct from .git/objects
. The git lfs prune
command only operates on the former, not the latter.
Why is the main that i pushed after migration only 1.2 gig, but the repo that i cloned is nearly 2 gig? The repo that i cloned have a mix of pointers and objects, whereas my latest push has only objects - which obviously should take more space?
To answer this fully I think we'd need to know how you're determining those sizes. A specific single Git LFS object in a repository may appear in either or both of your local working tree (if it's been "smudged" into place, to replace a raw pointer file) or your local Git LFS cache. If you don't want the files to be duplicated between the working tree and the cache, and your system supports it, the git lfs dedup
command may help in this regard.
In addition, if you've previously run git lfs migrate import
in the same working tree, any Git objects which were converted Git LFS objects may still exist in Git's various internal files, although they're not part of your Git history anymore. There was a recent issue, #5786, where the resolution was to instruct Git to prune all the now-unreachable objects after the Git LFS migration, to reduce the on-disk storage space. A fresh clone of the post-migration repository, though, should not have this issue.
You mention trying to prune the Git objects with git reflog expire
and git gc
. FWIW, I've found the command like the following can be helpful when trying to purge all unreachable Git objects (this is a simplified version from what's suggested in this StackOverflow question, as I didn't have any git rerere
data):
$ git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.pruneExpire=now gc
Why am i getting a mix of pointers and objects after cloning main?
Shouldn't they all be objects (indicated with asterisks)?
I'm not certain what might be affecting your particular clone statement in this case. You might try running the clone with GIT_TRACE=1 GIT_TRANSFER_TRACE=1 GIT_CURL_VERBOSE=1
to get more information about which files are and aren't being smudged automatically.
from git-lfs.
Related Issues (20)
- Git LFS still pulls with no .gitattributes file causing confusion HOT 1
- How to Use `git lfs prune` on Windows Environmen HOT 1
- [QUESTION] How to get upload lfs objects when pre-receive HOT 1
- Need RPM's for RHEL in s390x, ppc64le and other machines in Package Cloud HOT 1
- Error when pushing LFS objects: missing protocol: "<unknown>" HOT 1
- Git LFS pull should provide a bit more information on what's being pulled HOT 1
- pure SSH protocol connection failed: Unable to negotiate version with remote side (unable to read capabilities): EOF HOT 2
- 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 6
- 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
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.