Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use git lfs without API or other servers?

Tags:

git

git-lfs

I have already a local bare git repository without LFS, just for sharing the git, like it was supposed to.

This git will be utilized for stocking big images (singularity images) and my repo is already large (6 GB). However, I don’t particularly want to deploy an API or another server to use LFS, so I want to install locally. Is this possible ? It’s rentable ? When we use this, can we use the singularity images with a git pull? I search on the internet for a tutorial for that and I found this one Initialize bare git repository with LFS but it doesn’t correspond to my waiting, it’s talking about an API.

I already tried on another repository but when I attempted to push, there is this error message :

$ 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'

The /data/shared.git repository is my bare repository. I look in the section "Using a Custom Transfer Type without the API server" but I don't understand it, and I think the custom transfert is for a third part stockage server. I don't want it here.

$ 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"

Appreciate any help, thanks!

like image 644
Rilgar17 Avatar asked Jul 29 '19 12:07

Rilgar17


People also ask

Can you use git without a server?

Git will work happily without a central server, although many teams find it convenient to have a central repository. If by "server", you mean "install server software", git will also work (central repository or not) without any special software, through ssh or on the file system.

Is git LFS installed by default?

By default, git-lfs will be installed in /usr/local/bin , when using the manual installation or when using Homebrew. Therefore, you need to have an existing Git installation in /usr/local/bin and then select this Git installation in Tower.

When should git LFS be used?

You should use Git LFS if you have large files or binary files to store in Git repositories. That's because Git is decentralized. So, every developer has the full change history on their computer.

Where does git store LFS locally?

Git LFS stores the binary file content on a custom server or via GitHub, GitLab, or BitBucket's built-in LFS storage. To find the binary content's location, look in your repository's . git/lfs/objects folder.


1 Answers

I will answer my own question, yes it’s possible to use git lfs without an API. The response is on github, this address https://github.com/nathasm/git-lfs-rsync-agent or this address https://github.com/sinbad/lfs-folderstore is some example (I think). Even if some documentation are cheap.

For rsync, I recommend the nathasm repertory, instead of Aleb git, because there is an error when you charge the large file on your repertory. This error: is Smudge error: Error downloading objects … invalid cross-device link. On this git lfs-folderstore, there is the same error.

But I have already done it with the rsync one.

Thank you, everyone, and have a good day.

like image 65
Rilgar17 Avatar answered Oct 13 '22 21:10

Rilgar17