How it works
The Git LFS client communicates with the Gogs server over HTTP/HTTPS. It uses HTTP Basic Authentication to authorize client requests. Once a request is authorized, the Git LFS client receives instructions on where to fetch or push the large file.Server configuration
Git LFS works out of the box with the default configuration for any supported version of Gogs. All configuration options for Git LFS are located in the[lfs] section of custom/conf/app.ini:
| Option | Default | Description |
|---|---|---|
STORAGE | local | The storage backend for LFS objects. Currently only local is supported. |
OBJECTS_PATH | data/lfs-objects | The root path on the local file system where LFS objects are stored. |
Version requirements
To use Git LFS with your Gogs instance, you need:- Gogs version 0.12 or later
- Git LFS client version 1.0.1 or later
Using Git LFS
Git LFS endpoints in a Gogs server are automatically discovered by the Git LFS client, so you do not need to configure anything upfront.Install Git LFS
Install the Git LFS client on your machine. Most package managers include it:
Track large files
In your repository, tell Git LFS which file patterns to track:This creates or updates a
.gitattributes file. Make sure to commit it:Known limitations
No S3 or object storage support
No S3 or object storage support
Only local storage is supported. All LFS objects are stored on the same server where Gogs runs. Support for Object Storage Services like Amazon S3 is being tracked in gogs/gogs#6065.
SSH remotes use HTTP for LFS transfers
SSH remotes use HTTP for LFS transfers
When SSH is set as a remote, Git LFS objects still go through HTTP/HTTPS. Any Git LFS request will prompt for HTTP/HTTPS credentials, so a good Git credentials store is recommended.
No file locking support
No file locking support
File locking is not supported. This feature is being tracked in gogs/gogs#6064.