是否可以在不使用API​​或其他服务器的情况下使用git lfs?

时间:2019-07-29 12:59:50

标签: git git-lfs

我已经有一个没有LFS的本地裸git存储库,用于共享git,就像应该的那样。

此git将用于存储大图像(奇异图像),我的仓库已经很大(6 GB)。但是,我并不是特别想部署API或其他服务器来使用LFS,因此我想在本地安装。这可能吗 ?可租用的吗?使用此功能时,是否可以将奇点图像与git pull一起使用?我在互联网上搜索了相应的教程,但发现了一个Initialize bare git repository with LFS,但它与我的等待并不相符,它是在谈论API。

我已经在另一个存储库上尝试过,但是当我尝试推送时,出现此错误消息:

$ git push   

hint: The remote resolves to a file:// URL, which can only work with a
hint: standalone transfer agent.  See section "Using a Custom Transfer Type
hint: without the API server" in custom-transfers.md for details.
Remote "origin" does not support the LFS locking API. Consider disabling it with:
  $ git config lfs.file:///data/shared.git/info/lfs.locksverify false
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s                                                                         
hint: The remote resolves to a file:// URL, which can only work with a
hint: standalone transfer agent.  See section "Using a Custom Transfer Type
hint: without the API server" in custom-transfers.md for details.
batch request: missing protocol: "file:///data/shared.git/info/lfs"
error: impossible to push references to '/data/shared.git'

/data/shared.git存储库是我的裸存储库。我在“不使用API​​服务器的情况下使用自定义转帐类型”部分中查找,但我不理解,我认为自定义转帐适用于第三方库存服务器。我不想在这里。

$ git lfs env
git-lfs/2.8.0 (GitHub; linux amd64; go 1.12.6)
git version 2.17.1

Endpoint=file:///data/shared.git/info/lfs (auth=none)
LocalWorkingDir=/data/sing
LocalGitDir=/data/sing/.git
LocalGitStorageDir=/data/sing/.git
LocalMediaDir=/data/sing/.git/lfs/objects
LocalReferenceDirs=
TempDir=/data/sing/.git/lfs/tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=/data/sing/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic
UploadTransfers=basic
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"

感谢任何帮助,谢谢!

1 个答案:

答案 0 :(得分:0)

我将回答我自己的问题,是的,可以在不使用API​​的情况下使用git lfs。响应在github上,这个地址https://github.com/nathasm/git-lfs-rsync-agent或这个地址https://github.com/sinbad/lfs-folderstore是一个例子(我认为)。 即使某些文档很便宜。

对于rsync,我建议使用nathasm库,而不要使用Aleb git,因为在对库中的大文件收费时会出错。此错误:为Smudge错误:下载对象错误…无效的跨设备链接。在此git lfs-folderstore上,存在相同的错误。

但是我已经使用rsync做到了。

谢谢大家,祝你有美好的一天。

相关问题