简体   繁体   中英

Disable or properly install git LFS per remote

I have a git repository with two remotes configured.

One of those remotes is a local bare git repository, accessed over ssh (its url is ssh://username@host:/home/username/repo.git ) and it does not support git LFS.

Is it possible to disable LFS for that remote and make git push send original content of tracked files, instead of pointers?

I've followed advises from these articles, but they don't help:

Disable Git LFS for a remote

https://github.com/git-lfs/git-lfs/issues/3665#issuecomment-496549743

Command git push succeeds, but I've got pointer files instead of original content:

$ head ./src/LARGE-file.bin
version https://git-lfs.github.com/spec/v1
oid sha256:e4790eb8aeb78cc79ace0f3d9719875d95091fe97969302d6816f64b9f0f8850
size 1430976

To summarize, my goal is to enable git LFS for one remote and disable it for another.

Alternatively, it is also possible to configure LFS for that pure ssh remote, and I'd appreciate recommendations on how to do that.

The issue here is that what's actually in Git is the content-pointer files.

If you disable LFS for a remote, what you are really doing is saying when I send to the given remote, I don't want to send the real files to the LFS server, I just want to send the content pointers to the Git server.

To send the real files as part of a commit, they must actually be part of the commit. Remember that git push operates on commits, not files. Git-LFS operates on individual files whose content-pointers are stored in the underlying Git repository.

If you make commits that contain the actual files instead of content pointers, and send those commits instead of the commits that contain only content pointers, that would work; but note that this is a different / independent history that cannot easily be reconciled with the LFS-pointer-based history. There is probably no support built in to Git-LFS itself for this, as it would be kind of a nightmare to handle well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM