Using the latest version?
JFrog Platform User Guide


Skip to end of metadata
Go to start of metadata

Overview

From version 3.9, Artifactory supportsGit Large File Storage (LFS)repositories on top of Artifactory'sexisting supportfor advanced artifact management.

Artifactory support for Git LFS provides you with a fully functional LFS server that works with the Git LFS client.

LFS blobs from your Git repository can be pushed and maintained in Artifactory offering the following benefits:

  • Performance:
    Artifactory的文件存储在本地或corporate network, file download times may be significantly reduced. When considering the number of files that may be needed for a build, this can drastically reduce your build time and streamline your workflow.
  • Reliable and consistent access to binaries:
    With Artifactory as your LFS repository, all the resources you need for development and build are stored on your own local or corporate network and storage. This keeps you independent of the external network or any 3rd party services.
  • Share binary assets with remote Git LFS repositories
    Share your video, audio, image files and any other binary asset between teams across your organization by proxying Git LFS repositories on other Artifactory instances or on GitHub.
  • Upload and download binary assets using a single URL
    Use a virtual Git LFS repository as both a source and a target for binary assets. By wrapping local and remote repositories, and defining a deploy target in a virtual Git LFS repository, your Git LFS client only needs to be exposed to that single virtual repository for all your work with binary assets.

  • Security and access control:
    Artifactory lets you define which users or groups of users can access your LFS repositories with a full set of permissions you can configure. You can control where developers can deploy binary assets to, whether they can delete assets and more. And if it’s access to your servers that you’re concerned about, Artifactory provides full integration with the most common access protocols such as LDAP, SAML, Crowd and others.
  • One solution for all binaries:
    Once you are using Artifactory to store media assets there is no need to use a 3rd party LFS provider. Artifactory can now handle those along with all the other binaries it already manages for you.
Page Contents



配置

局部存储库

To create a Git LFS local repository and enablecalculation of LFS package metadata setGitLfsas thePackage Type.

Remote Repositories

You can create a Git LFSremote repositoryto proxy Git LFS local repositories on other Artifactory instances and enjoy all the features of asmart remote repository.

To define a Git LFS remote repository, create a new remote repository, set its Package Type to beGit LFS, and set the URL of the repository you want to proxy.

Git LFS remote repository

Virtual Repositories

A Virtual Repository defined in Artifactory aggregates packages from both local and remote repositories.
This allows you to access both locally hosted binary assets and remote proxied git LFS repositories from a single URL defined for the virtual repository.

To create a Git LFS virtual repository setGit LFSto be its Package Type,and select the underlying local and remote Git LFS repositories to include under theRepositoriessection.

Make sure you also set theDefault Deployment Repositoryso you can both download from and upload to this repository.

Git LFS virtual repository

Setting Up the Git LFS Client to Point to Artifactory

In order for your client to upload and download LFS blobs from artifactory the[lfs]clause should be added to the .lfsconfigfile of your Git repository in the following format.

.lfsconfig
[lfs] url = "https:///api/lfs/" For example: [lfs] url = "https://localhost:8080/artifactory/api/lfs/lfs-local"

You can also set different LFS endpoints for different remotes on your repo (as supported by the Git LFS client), for example:

.git/config different lfs url for remotes
[remote "origin"] url = https://... fetch = +refs/heads/*:refs/remotes/origin/* lfsurl = "http://localhost:8081/artifactory/api/lfs/lfs-local"

Copy these clauses using Set Me Up

If you select your GitLFS repository in the Tree Browser and clickSet Me Up,Artifactory will display these clauses in a dialog from which you can simply copy and paste them.

Working with Proxies and HTTPS

When using HTTPS (i.e. behind a proxy) with a self signed certificate your configuration might also require you to add the following:

.gitconfig http section
[http] sslverify = false
Always consult your System Administrator before bypassing secure protocols in this way.

When running Artifactory behind a proxy, defining abase urlis usually required (depending on configuration) due to the operation of the
Git LFS client which expectsto receive redirect urls to the exact upload \ download location of blobs.

LFS repositories must be prefixed with api/lfs in the path

When accessing a Git LFS repository through Artifactory, the repository URL must be prefixed withapi/lfsin the path,except when configuring replication.

For example, if you are using Artifactory standalone or as a local service, you would access your LFS repositories using the following URL:

http://localhost:8081/artifactory/api/lfs/

Or, if you are using SaaS the URL would be:

https://.jfrog.io//api/lfs/


When configuring replication, reference the repository's browsable url i.e.;

http://localhost:8081/artifactory/


Working with Artifactory without Anonymous Access

By default, Artifactory allows anonymous access to Git LFS repositories. This is defined in theAdminmodule underSecurity | General. For details please refer toAllow Anonymous Access.
If you want to be able to trace how users interact with your repositories you need to uncheck theAllow Anonymous Accesssetting. This means that users will be required to enter their username and password.
The Git LFS client will ask for credentials for the Artifactory LFS repo when accessing it - if anonymous access is allowed you can just enter blank credentials, otherwiseyou should enter your Artifactory user name and password (not your Git one).

To make the authentication process automatic you can useGit Credential Helpersto store these for you, and have the Git LFS client authenticate automatically.

Git stores credentials in plain text by default

You should take extra measures to secure your username and password when using Git credential helpers


Authenticating with SSH

From version 4.4, Artifactory supports authenticating your Git LFS client via SSH.

To authenticate yourself via SSH when using the Git LFS client, execute the following steps:

  • Make sure Artifactory is properly configured for SSH as described inConfiguring Server Authentication.
    SSH Server Settings
  • Upload your SSH Public Key in the SSH section of your user profileas described inConfiguring User Authentication.
  • Configure the Git LFS client as follows:
    • Update theknown_hostsfile with the Artifactory server public key. This file is located under~/.ssh/known_hosts(and there is also a system-wide file under/etc/ssh/known_hosts).This should take the following format:
      []:
      For example,

      [myartifactory.company.com]:1339 ssh-rsa AAAAB3Nza...PC0GuTJT9TlaYD user@domain.com
    • Update your.lfsconfigfile at the repository level (not the global level) as follows:
      ssh: / /使用美元RNAME@$HOST:$PORT/artifactory/
      For example,

      url = "ssh://git@myartifactory.company.com:1339/artifactory/lfs-local"

Artifactory Online Dedicated Server

If you are using a dedicated server on Artifactory SaaS and wish to authenticate via SSH, please contactsupport@www.si-fil.com.


Metadata

As the Git LFS client supplies only limited data about the blob being uploaded (only it's sha256 checksum, or 'OID', and it's size) Artifactory does not store or process any metadata for LFS blobs.

You can set properties on the blobs for your own convenience but this requires extra logic to infer a sha256-named file stored in artifactory from the actual pointer stored in your Git repository.


Storage

Artifactory stores LFS blobs in a manner similar to the Git LFS client, using the provided sha256 checksum.

Git LFS blobs will be stored under a path such as/objects/ad/1b/ad1b8d6e1cafdf33e941a5de462ca7edfa8818a70c79feaf68e5ed53dec414c4

Whereadand1bare the 1st and 2nd, and the 3rd and 4th characters in the blob's name respectively.


Git LFS behavior when download from the LFS endpoint fails

The Git LFS client will download the pointer file it created in your remote Git repository if downloading the blob from the LFS endpoint failed (i.e. wrong credentials, network error etc.).

这将导致实际的文件在您的本地回购to be substituted with the pointer created by the LFS clientwith the same nameand lead to any number of problems this behavior can cause.

This is a limitation of the LFS client tracked byissue 89.


Quick Start Guide

Visit our Knowledge Base for aquick start guide of Git LFS with Artifactory.