首页 > 解决方案 > Visual Studio、TFS 和 Git LFS:如何设置远程存储?

问题描述

来自微软文档

Git LFS 是 Git 的扩展,它将描述大文件的数据提交到你的 repo,并将二进制文件内容存储到单独的远程存储中。

这听起来不错,但是我找不到任何地方可以设置远程存储?对我们来说,重点是不要使用与 TFS 服务器相同的驱动器来存储二进制文件,这对于 Git-LFS 似乎是可行的。我对 Git 很陌生,我们想从 TFSVC 迁移到 Git,但其余部分保留 TFS。

标签: gitvisual-studiotfswindows-10git-lfs

解决方案


您可以查看以下文档:

https://help.github.com/en/enterprise/2.20/admin/installation/configuring-git-large-file-storage-to-use-a-third-party-server

默认情况下,Git Large File Storage 客户端将大型资产存储在托管 Git 存储库的同一台服务器上。但是您可以将 Git 大文件存储配置为使用第三方服务器。尝试创建一个指向第三方服务器的 Git LFS 配置文件:

# 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

推荐阅读