- Как установить git-lfs в Ubuntu 16.04?
- 4 ответа
- Git lfs install linux
- Русские Блоги
- Как установить и использовать git lfs
- Что такое GIT LFS
- Способ установки
- Интеллектуальная рекомендация
- Пошаговая загрузка файла Spring MVC-09 (на основе файла загрузки клиента Servlet3.0 + Html5)
- Создайте многоканальное окно в приложениях Win32
- Путь к рефакторингу IOS-APP (3) Введение в модульное тестирование
- Tree——No.617 Merge Two Binary Trees
- Git Large File Storage (LFS)
- How it works
- GitLab server configuration
- Requirements
- Known limitations
- Using Git LFS
- Migrate an existing repository to Git LFS
- Removing objects from LFS
- File Locking
- LFS objects in project archives
- Troubleshooting
- Encountered n file(s) that should have been pointers, but weren’t
- error: Repository or object not found
- Invalid status for : 501
- getsockopt: connection refused
- Credentials are always required when pushing an object
- LFS objects are missing on push
- Hosting LFS objects externally
Как установить git-lfs в Ubuntu 16.04?
Я пытаюсь установить пакет git-lfs, и похоже, что ожидаемые пути не являются дружественными для Ubuntu. В разделе «Загрузки» git-lfs я выбираю имя файла Linux AMD64 git-lfs-freebsd-amd64-1.2.1.tar.gz потому что.deb файлы не доступны для Ubuntu, только Debian 7,8.
Я получаю ошибку: install.sh: 19: install.sh: PATH+=:/usr/local/bin: not found при выполнении install.sh.
У кого-нибудь есть рабочее решение о том, как установить git-lfs?
4 ответа
Я нашел свое решение, проблема заключалась в выполнении install.sh с помощью sh :
Правильный путь sudo ./install.sh или же sudo bash install.sh вместо sh install.sh ,
Есть на самом деле .deb файлы по адресу https://packagecloud.io/github/git-lfs?filter=debs которые вы можете установить; ссылка, которую вы посетили, также намекала на это, заявляя, что «Все пакеты доступны в PackageCloud сейчас».
В любом случае, если вы посетите https://git-lfs.github.com/, самый простой способ установить git-lfs это следовать инструкциям на https://packagecloud.io/github/git-lfs/install:
Если вы не доверяете источнику script.deb.sh и неудобно запускать скрипт с sudo bash , вы должны обязательно взглянуть на сценарий в первую очередь.
Я искал способ установки полностью из командной строки (настройка сервера / виртуальной машины) и смог сделать это, следуя инструкциям из документации, скопированной ниже для справки.
- sudo apt-get install software-properties-common
- sudo curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash *
- sudo apt-get install git-lfs
- git lfs install
* Sudo на шаге 2 — это мое дополнение, и без него этот шаг молча провалился. Может быть, делать с моими пользовательскими разрешениями на сервере? YMMV
Источник
Git lfs install linux
Git Large File Storage
Git LFS is a command line extension and specification for managing large files with Git.
The client is written in Go, with pre-compiled binaries available for Mac, Windows, Linux, and FreeBSD. Check out the website for an overview of features.
You can install the Git LFS client in several different ways, depending on your setup and preferences.
- Linux users. Debian and RPM packages are available from PackageCloud.
- macOS users. Homebrew bottles are distributed, and can be installed via brew install git-lfs .
- Windows users. Git LFS is included in the distribution of Git for Windows. Alternatively, you can install a recent version of Git LFS from the Chocolatey package manager.
- Binary packages. In addition, binary packages are available for Linux, macOS, Windows, and FreeBSD.
- Building from source. This repository can also be built from source using the latest version of Go, and the available instructions in our Wiki.
The binary packages include a script which will:
- Install Git LFS binaries onto the system $PATH
- Run git lfs install to perform required global configuration changes.
- Ensure you have the latest version of Go, GNU make, and a standard Unix-compatible build environment installed.
- On Windows, install goversioninfo with go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo .
- Run make .
- Place the git-lfs binary, which can be found in bin , on your system’s executable $PATH or equivalent.
- Git LFS requires global configuration changes once per-machine. This can be done by running:
Releases are signed with the OpenPGP key of one of the core team members. To get these keys, you can run the following command, which will print them to standard output:
Once you have the keys, you can download the sha256sums.asc file and verify the file you want like so:
To begin using Git LFS within a Git repository that is not already configured for Git LFS, you can indicate which files you would like Git LFS to manage. This can be done by running the following from within a Git repository:
(Where *.psd is the pattern of filenames that you wish to track. You can read more about this pattern syntax here).
Note: the quotation marks surrounding the pattern are important to prevent the glob pattern from being expanded by the shell.
After any invocation of git-lfs-track(1) or git-lfs-untrack(1) , you must commit changes to your .gitattributes file. This can be done by running:
You can now interact with your Git repository as usual, and Git LFS will take care of managing your large files. For example, changing a file named my.psd (tracked above via *.psd ):
Tip: if you have large files already in your repository’s history, git lfs track will not track them retroactively. To migrate existing large files in your history to use Git LFS, use git lfs migrate . For example:
You can confirm that Git LFS is managing your PSD file:
Once you’ve made your commits, push your files to the Git remote:
Note: Git LFS requires at least Git 1.8.2 on Linux or 1.8.5 on macOS.
If you’ve decided that Git LFS isn’t right for you, you can convert your repository back to a plain Git repository with git lfs migrate as well. For example:
Note that this will rewrite history and change all of the Git object IDs in your repository, just like the import version of this command.
If there’s some reason that things aren’t working out for you, please let us know in an issue, and we’ll definitely try to help or get it fixed.
Git LFS maintains a list of currently known limitations, which you can find and edit here.
Git LFS source code utilizes Go modules in its build system, and therefore this project contains a go.mod file with a defined Go module path. However, we do not maintain a stable Go language API or ABI, as Git LFS is intended to be used solely as a compiled binary utility. Please do not import the git-lfs module into other Go code and do not rely on it as a source code dependency.
You can get help on specific commands directly:
The official documentation has command references and specifications for the tool. There’s also a FAQ on the wiki which answers some common questions.
If you have a question on how to use Git LFS, aren’t sure about something, or are looking for input from others on tips about best practices or use cases, feel free to start a discussion.
You can always open an issue, and one of the Core Team members will respond to you. Please be sure to include:
- The output of git lfs env , which displays helpful information about your Git repository useful in debugging.
- Any failed commands re-run with GIT_TRACE=1 in the environment, which displays additional information pertaining to why a command crashed.
See CONTRIBUTING.md for info on working on Git LFS and sending patches. Related projects are listed on the Implementations wiki page.
See also SECURITY.md for info on how to submit reports of security vulnerabilities.
These are the humans that form the Git LFS core team, which runs the project.
In alphabetical order:
These are the humans that have in the past formed the Git LFS core team, or have otherwise contributed a significant amount to the project. Git LFS would not be possible without them.
Источник
Русские Блоги
Как установить и использовать git lfs
Что такое GIT LFS
LFS — это сокращение от Large File Storage, используемое, чтобы помочь git управлять большими файлами.
Принцип: В отличие от git, сохраняющего diff каждый раз, для git, если это модель или несколько больших файлов дизайна, его небольшое изменение увеличит объем хранилища, и через несколько минут будет несколько G. Для git lfs, после использования команды git lfs track, когда git push, git lfs перехватит управляемый большой файл и передаст его на сервер git lfs, тем самым уменьшив размер хранилища
Способ установки
Примечание: git lfs требует git> = 1.8.2
1. способ установки Centos
Вы можете следить за тем, что предусмотрено на GitHubСпособ установкиЗапустите следующую команду для установки:
Следуйте инструкциям официального представителя Centos, чтобы сообщить об ошибке, что, вероятно, означает, что установочный пакет не может быть загружен
Установить с помощью пакета rpm, изОфициальный сайтСкачайте установочный пакет для установки, способ установки выглядит следующим образом:
Найдите «Загрузки» на официальном веб-сайте, указанном выше, а затем выберите соответствующий пакет установки системы для загрузки.
Для centos, скачать rpm (доступно через lsb_release -a Посмотреть версию системы)
Используйте после загрузки пакета rpm sudo rpm -ivh имя пакета.rpm Установить
пробег git lfs install , Если отображается Git LFS initialized, установка прошла успешно
2. установка macos
пробег brew install git-lfs Готов к установке
3. Как использовать
- Скажите lfs для управления большими файлами, такими как model.pb, запустите команду git lfs track model.pb
- Добавьте файл управления .gitattributes в репозиторий git. git add .gitattributes
- Добавьте большие файлы в репозиторий git, а затем добавьте их таким же образом
Интеллектуальная рекомендация
Пошаговая загрузка файла Spring MVC-09 (на основе файла загрузки клиента Servlet3.0 + Html5)
пример тестовое задание Исходный код Несмотря на загрузку файлов в Servlet3.0 +, мы можем очень легко программировать на стороне сервера, но пользовательский интерфейс не очень дружелюбен. Одна HTML-ф.
Создайте многоканальное окно в приложениях Win32
Создайте многоканальное окно в приложениях Win32, создайте несколько оконных объектов одного и того же класса Windows, а окна объектов разных классов окон. .
Путь к рефакторингу IOS-APP (3) Введение в модульное тестирование
IOS-APP реконструкция дороги (1) структура сетевых запросов IOS-APP реконструкция дороги (два) Модельный дизайн При рефакторинге нам нужна форма, позволяющая вносить смелые изменения, обеспечивая при .
Tree——No.617 Merge Two Binary Trees
Problem: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge them into a new bin.
Источник
Git Large File Storage (LFS)
Managing large files such as audio, video and graphics files has always been one of the shortcomings of Git. The general recommendation is to not have Git repositories larger than 1GB to preserve performance.
Files tracked by Git LFS display an icon to indicate if the file is stored as a blob or an LFS pointer.
How it works
Git LFS client talks with the GitLab server over HTTPS. It uses HTTP Basic Authentication to authorize client requests. After the request is authorized, Git LFS client receives instructions from where to fetch or where to push the large file.
GitLab server configuration
Documentation for GitLab instance administrators is under LFS administration doc.
Requirements
- Git LFS is supported in GitLab starting with version 8.2
- Git LFS must be enabled under project settings
- Git LFS client version 1.0.1 and up
Known limitations
- Git LFS v1 original API is not supported, because it was deprecated early in LFS development.
- When SSH is set as a remote, Git LFS objects still go through HTTPS.
- Any Git LFS request asks for HTTPS credentials to be provided so a good Git credentials store is recommended.
- Git LFS always assumes HTTPS so if you have GitLab server on HTTP you must add the URL to Git configuration manually.
Using Git LFS
Lets take a look at the workflow when you need to check large files into your Git repository with Git LFS. For example, if you want to upload a very large file and check it into your Git repository:
After you mark a file extension for tracking as a LFS object you can use Git as usual without redoing the command to track a file with the same extension:
Make sure that .gitattributes is tracked by Git. Otherwise Git LFS doesn’t work properly for people cloning the project:
Cloning the repository works the same as before. Git automatically detects the LFS-tracked files and clones them via HTTP. If you performed the git clone command with a SSH URL, you have to enter your GitLab credentials for HTTP authentication.
If you already cloned the repository and you want to get the latest LFS object that are on the remote repository, such as for a branch from origin:
Make sure your files aren’t listed in .gitignore , otherwise, they are ignored by Git and are not pushed to the remote repository.
Migrate an existing repository to Git LFS
Removing objects from LFS
To remove objects from LFS:
- Use git filter-repo to remove the objects from the repository.
- Delete the relevant LFS lines for the objects you have removed from your .gitattributes file and commit those changes.
File Locking
See the documentation on File Locking.
LFS objects in project archives
- Support for including Git LFS blobs inside project source downloads was introduced in GitLab 13.5.
- Enabled by default in GitLab 13.6.
- Enabled on GitLab.com.
- Recommended for production use.
Prior to GitLab 13.5, project source downloads would include Git LFS pointers instead of the actual objects. For example, LFS pointers look like the following:
In GitLab version 13.5 and later, these pointers are converted to the uploaded LFS object.
Technical details about how this works can be found in the development documentation for LFS.
Troubleshooting
Encountered n file(s) that should have been pointers, but weren’t
This error indicates the file (or files) are expected to be tracked by LFS, but for some reason the repository is not tracking them as LFS. This issue can be one potential reason for this error: Files not tracked with LFS when uploaded through the web interface
To resolve the problem, migrate the affected file (or files) and push back to the repository:
Migrate the file to LFS:
Push back to your repository:
(Optional) Clean up your .git folder:
error: Repository or object not found
There are a couple of reasons why this error can occur:
- You don’t have permissions to access certain LFS object
Check if you have permissions to push to the project or fetch from the project.
- Project is not allowed to access the LFS object
LFS object you are trying to push to the project or fetch from the project is not available to the project anymore. Probably the object was removed from the server.
- Local Git repository is using deprecated LFS API
Invalid status for : 501
Git LFS logs the failures into a log file. To view this log file, while in project directory:
If the status error 501 is shown, it is because:
Git LFS is not enabled in project settings. Check your project settings and enable Git LFS.
Git LFS support is not enabled on the GitLab server. Check with your GitLab administrator why Git LFS is not enabled on the server. See LFS administration documentation for instructions on how to enable LFS support.
Git LFS client version is not supported by GitLab server. Check your Git LFS version with git lfs version . Check the Git configuration of the project for traces of deprecated API with git lfs -l . If batch = false is set in the configuration, remove the line and try to update your Git LFS client. Only version 1.0.1 and newer are supported.
getsockopt: connection refused
If you push an LFS object to a project and receive an error like this, the LFS client is trying to reach GitLab through HTTPS. However, your GitLab instance is being served on HTTP:
This behavior is caused by Git LFS using HTTPS connections by default when a lfsurl is not set in the Git configuration.
To prevent this from happening, set the LFS URL in project Git configuration:
Credentials are always required when pushing an object
Git LFS authenticates the user with HTTP Basic Authentication on every push for every object, so user HTTPS credentials are required.
By default, Git has support for remembering the credentials for each repository you use. This is described in Git credentials man pages.
For example, you can tell Git to remember the password for a period of time in which you expect to push the objects:
This remembers the credentials for an hour, after which Git operations require re-authentication.
If you are using OS X you can use osxkeychain to store and encrypt your credentials. For Windows, you can use wincred or Microsoft’s Git Credential Manager for Windows.
More details about various methods of storing the user credentials can be found on Git Credential Storage documentation.
LFS objects are missing on push
GitLab checks files to detect LFS pointers on push. If LFS pointers are detected, GitLab tries to verify that those files already exist in LFS on GitLab.
Verify that LFS is installed locally and consider a manual push with git lfs push —all .
If you are storing LFS files outside of GitLab you can disable LFS on the project by setting lfs_enabled: false with the projects API.
Hosting LFS objects externally
It is possible to host LFS objects externally by setting a custom LFS URL with git config -f .lfsconfig lfs.url https://example.com/
You might choose to do this if you are using an appliance like a Sonatype Nexus to store LFS data. If you choose to use an external LFS store, GitLab can’t verify LFS objects. Pushes then fail if you have GitLab LFS support enabled.
To stop push failure, LFS support can be disabled in the Project settings, which also disables GitLab LFS value-adds (Verifying LFS objects, UI integration for LFS).
Источник