Publicamos atualizações frequentes em nossa documentação, e a tradução desta página ainda pode estar em andamento. Para obter as informações mais recentes, acesse a documentação em inglês. Se houver problemas com a tradução desta página, entre em contato conosco.
Versão do artigo: Enterprise Server 2.21

Configuring Git Large File Storage for your enterprise

Git Large File Storage (Git LFS) é uma extensão de código aberto para Git que permite trabalhar com arquivos grandes da mesma maneira que com outros arquivos de texto.

Neste artigo

About Git Large File Storage

Git Large File Storage (Git LFS) é uma extensão de código aberto para Git que permite trabalhar com arquivos grandes da mesma maneira que com outros arquivos de texto. You can use Git Large File Storage with a single repository, all of your personal or organization repositories, or with every repository in sua instância do GitHub Enterprise Server. Before you can enable Git LFS for specific repositories or organizations, you need to enable Git LFS for your appliance.

By default, the Git Large File Storage client stores large assets on the same server that hosts the Git repository. When Git LFS is enabled on the GitHub Enterprise Server appliance, large assets are stored on the data partition in /data/user/storage. Os usuários não poderão fazer push de ativos do Git LFS para o GitHub Enterprise Server se Git LFS estiver desabilitado no appliance ou no repositório.

For more information, see "About Git Large File Storage", "Versioning large files," and the Git Large File Storage project site.

Configuring Git Large File Storage for your appliance

  1. In the upper-right corner of any page, click .
    Ícone de foguete para acessar as configurações de administrador do site
  2. In the left sidebar, click Enterprise.
    Enterprise tab in the Site admin settings
  3. In the enterprise account sidebar, click Settings.
    Settings tab in the enterprise account sidebar
  4. Under " Settings", click Options.
    Options tab in the enterprise account settings sidebar
  5. Under "Git LFS access", use the drop-down menu, and click Enabled or Disabled.
    Git LFS Access

Configuring Git Large File Storage for an individual repository

Note: Each repository automatically inherits default settings from the organization or user that owns it. You cannot override the default setting if the repository's owner has enforced the setting on all of their repositories.

  1. In the upper-right corner of any page, click .
    Ícone de foguete para acessar as configurações de administrador do site
  2. In the search field, type the name of the repository and click Search.
    campo de pesquisa de configurações de administrador do site
  3. In the search results, click the name of the repository.
    Site admin settings search options
  4. In the upper-right corner of the page, click Admin.
    Admin Tools
  5. In the left sidebar, click Admin.
    Admin Tools
  6. Under "Git LFS", click Enable or Disable.
    Disable button

Configuring Git Large File Storage for every repository owned by a user account or organization

  1. In the upper-right corner of any page, click .
    Ícone de foguete para acessar as configurações de administrador do site
  2. In the search field, type the name of the user or organization and click Search.
    campo de pesquisa de configurações de administrador do site
  3. In the search results, click the name of the user or organization.
    Site admin settings search options
  4. In the upper-right corner of the page, click Admin.
    Admin Tools
  5. In the left sidebar, click Admin.
    Admin Tools
  6. Under "Git LFS", click Enable or Disable.
    Disable button

Configuring Git Large File Storage to use a third party server

By default, the Git Large File Storage client stores large assets on the same server that hosts the Git repository. When Git LFS is enabled on the GitHub Enterprise Server appliance, large assets are stored on the data partition in /data/user/storage. Os usuários não poderão fazer push de ativos do Git LFS para o GitHub Enterprise Server se Git LFS estiver desabilitado no appliance ou no repositório.

  1. Disable Git LFS on the GitHub Enterprise Server appliance. For more information, see "Configuring Git Large File Storage."

  2. Create a Git LFS configuration file that points to the third party server.

    # Show default configuration
    $ git lfs env
    > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c)
    > git version 2.7.4 (Apple Git-66)
     
    > Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic)
     
    # Create .lfsconfig that points to third party server.
    $ git config -f .lfsconfig remote.origin.lfsurl https://THIRD-PARTY-LFS-SERVER/path/to/repo
    $ git lfs env
    > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c)
    > git version 2.7.4 (Apple Git-66)
     
    > Endpoint=https://THIRD-PARTY-LFS-SERVER/path/to/repo/info/lfs (auth=none)
     
    # Show the contents of .lfsconfig
    $ cat .lfsconfig
    [remote "origin"]
    lfsurl = https://THIRD-PARTY-LFS-SERVER/path/to/repo
  3. To keep the same Git LFS configuration for each user, commit a custom .lfsconfig file to the repository.

    $ git add .lfsconfig
    $ git commit -m "Adding LFS config file"
  4. Migrate any existing Git LFS assets. For more information, see "Migrating to a different Git Large File Storage server."

Migrating to a different Git Large File Storage server

Before migrating to a different Git Large File Storage server, you must configure Git LFS to use a third party server. For more information, see "Configuring Git Large File Storage to use a third party server."

  1. Configure the repository with a second remote.

    $ git remote add NEW-REMOTE https://NEW-REMOTE-HOSTNAME/path/to/repo
     
    $ git lfs env
    > git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1; git 94d356c)
    > git version 2.7.4 (Apple Git-66)
     
    > Endpoint=https://GITHUB-ENTERPRISE-HOST/path/to/repo/info/lfs (auth=basic)
    > Endpoint (NEW-REMOTE)=https://NEW-REMOTE-HOSTNAME/path/to/repo/info/lfs (auth=none)
  2. Fetch all objects from the old remote.

    $ git lfs fetch origin --all
    > Scanning for all objects ever referenced...
    > ✔ 16 objects found
    > Fetching objects...
    > Git LFS: (16 of 16 files) 48.71 MB / 48.85 MB
  3. Push all objects to the new remote.

    $ git lfs push NEW-REMOTE --all
    > Scanning for all objects ever referenced...
    > ✔ 16 objects found
    > Pushing objects...
    > Git LFS: (16 of 16 files) 48.00 MB / 48.85 MB, 879.10 KB skipped

Further reading

Pergunte a uma pessoa

Não consegue encontrar o que procura?

Entrar em contato