Cloud Build中的Git LFS支持

Cloud Build for Unity Teams is a continuous integration service for games and apps built in Unity. Cloud Build makes it simple and easy to create and share builds of your game, letting you and your team iterate faster and always be on the same page. Setting up Cloud Build takes seconds and works with your existing source control repository.

云生成˚Fø - [R U n 所 I TýT E 一 米 每秒 为游戏和应用程序内置于统一的连续集成服务。 Cloud Build使创建和共享游戏版本变得简单容易,让您和您的团队可以更快地迭代,并且始终在同一页面上。 设置Cloud Build只需几秒钟,即可与您现有的源代码控制存储库一起使用。

Cloud Build now supports Large File Storage in Git source control repos, also known as Git LFS for short.  So now, you can create larger builds with Cloud Build when using it with Git!  Read on to learn more.

Cloud Build现在在Git源代码控制存储库(也简称为Git LFS)中支持大文件存储。 因此,现在,与Git一起使用时,您可以使用Cloud Build创建更大的版本! 请继续阅读以了解更多信息。

什么是Git LFS? (What is Git LFS?)

Git Large File Storage (LFS) is a technology that allows providers to keep large assets/files outside of a Git repository, keeping total filesize down while still maintaining important base assets alongside the project. When a file is added to a traditional Git repository, Git maintains a separate copy of every version of that file. This is great for files containing code, or very small binary/image files. However, this becomes a problem with large files, and providers may warn or prevent you from uploading your changes. Git LFS allows providers and users alike to maintain leaner repositories.

Git大文件存储(LFS)是一项技术,允许提供程序将大型资产/文件保留在Git存储库之外,减少总文件大小,同时仍与项目一起维护重要的基础资产。 将文件添加到传统的Git存储库后,Git会维护该文件每个版本的单独副本。 这对于包含代码的文件或非常小的二进制/图像文件非常有用。 但是,这成为大文件的问题,提供商可能会警告或阻止您上传更改。 Git LFS允许提供者和用户都维护精简存储库。

如何在Cloud Build中使用Git LFS? (How do I use Git LFS with Cloud Build?)

There are no special steps for Cloud Build to recognize LFS; it just works!  As with all Cloud Build projects using git, simply add the SSH key provided in your project’s Source Control Settings area to a user on GitHub with access to the repo. Cloud Build will recognize the need to use LFS and download your files accordingly before a build begins. Need a walkthrough? Check out this video, showing how to setup Cloud Build.

Cloud Build没有识别LFS的特殊步骤。 它就可以了! 与所有使用git的Cloud Build项目一样,只需将项目的“源代码控制设置”区域中提供的SSH密钥添加到GitHub上有权访问该存储库的用户即可。 在构建开始之前,Cloud Build会认识到需要使用LFS并相应地下载文件。 需要演练吗? 观看此视频 ,了解如何设置Cloud Build。

Git LFS如何工作? (How does Git LFS work?)

The Git LFS client is a command line utility that sits next to the existing git command line executable and interoperates with it. It allows a developer to track certain files within their repository, which marks them for management by the LFS subsystem. These files are replaced with text-based pointer files in the repository, and the files they represent are uploaded and stored separately outside of the repository. Upon checkout, Cloud Build uses the Git LFS client to determine where these files are and pull them down before your build.

Git LFS客户端是一个命令行实用程序,位于现有git命令行可执行文件旁边,并且可以与其互操作。 它允许开发人员跟踪其存储库中的某些文件,从而将其标记为由LFS子系统进行管理。 这些文件在存储库中替换为基于文本的指针文件,并且它们表示的文件分别上载和存储在存储库外部。 签出后,Cloud Build会使用Git LFS客户端确定这些文件的位置,并在构建之前将其拉下。

如何使用Git LFS? (How do I use Git LFS?)

Download and installation instructions for Git end users can be found on the Git LFS website, and can be used with any Git–based source control where LFS has been implemented. Once installed, the git lfs track command is used to specify which files should be handled by the LFS system:

GIT中的最终用户下载和安装说明可以发现 在GIT中LFS网站上 , 正 dç 正 Béù 发 E d w i 的 吨 h 的 N Y G I 吨 - B A 发 E d S 0ùR C èC 0 N t 个 R 0 L其中LFS已经实施。 安装后, git lfs track 命令用于指定LFS系统应处理哪些文件:

1

$ git lfs track "**/*.wav"

1

$ git lfs track "**/*.wav"

This example command will generate or add to a .gitattributes file, specifying that all WAV files should be tracked by LFS. That’s it! All WAV files will be managed via Git LFS. Additional file names or wildcards can be specified with the git lfs track command. Note: Please be sure to include the .gitattributes file when you commit changes.

此示例命令将生成或添加到.gitattributes文件,并指定LFS应当跟踪所有WAV文件。 而已! 所有WAV文件将通过Git LFS进行管理。 可以使用 git lfs track 命令 指定其他文件名或通配符 。 注意: 提交更改时,请确保包含.gitattributes文件。

Git LFS提供程序支持 (Git LFS Provider Support)

GitHub is the source of the Git LFS project, and as such is the most prominent server implementation at this time. There are other services that also offer Git LFS support, however they do not currently support using LFS with SSH keys. In order to use a Git LFS host with Unity Cloud Build, they must allow authorization for it via SSH. Some other notes should be taken into consideration:

GitHub是 Git LFS项目 的来源, 因此是当前最杰出的服务器实现。 还有其他服务也提供Git LFS支持,但是目前不支持将LFS与SSH密钥一起使用。 为了在Unity Cloud Build中使用Git LFS主机,他们必须允许通过SSH对其进行授权。 还应考虑其他一些注意事项:

  • GitHub deployment keys are not supported: SSH keys are handled in various ways within GitHub, and usage of LFS via deployment key is not currently supported. An alternative approach is the use of machine users, or separate user accounts that the SSH key can be used with.

    不支持GitHub部署密钥: SSH密钥在GitHub中以各种方式处理,并且当前不支持通过部署密钥使用LFS。 另一种方法是使用 计算机用户 ,或者可以使用SSH密钥的单独用户帐户。

  • Bandwidth and storage are likely measured: Git LFS is a bandwidth and storage intensive service, and as such, there are likely charges associated with both when heavily utilizing it. In GitHub’s case, free usage is capped at 1GB per month for bandwidth and 1GB of storage. In addition to any caps, it’s important to take any additional hosting costs into account.

    带宽和存储可能会进行测量: Git LFS是带宽和存储密集型服务,因此,在大量使用它时可能会产生费用。 在GitHub的情况下 ,免费使用的上限为每月1GB的带宽和1GB的存储空间。 除了上限,重要的是要考虑任何额外的托管费用。

结论 (Conclusion)

In conclusion, Git LFS is a great option to consider when utilizing Git as your method of source control while using Unity and Unity’s services. If using Git LFS seems complicated, but your project works with large files, try out Collaborate for Unity Teams.  It handles large files without any extra effort, and setting it up to work with Cloud Build is super simple.  No bandwidth limits to worry about either; just storage.

总之,在使用Unity和Unity服务时,将Git用作源代码控制方法时,Git LFS是一个不错的选择。 如果使用Git LFS看起来很复杂,但是您的项目可以处理大文件,请尝试 Collaborate for Unity Teams。 它可以轻松处理大型文件,并且将其设置为与Cloud Build配合使用非常简单。 没有带宽限制,无需担心; 只是存储。

The Cloud Build team works hard to support the needs of Unity developers that wish to take advantage of continuous integration in their development pipelines. We look forward to improving the service even more as time goes on. Happy building!

Cloud Build团队努力工作,以支持希望在开发管道中进行持续集成的Unity开发人员的需求。 随着时间的流逝,我们期待进一步改善服务。 建设愉快!

Cloud Build is built right into Unity. Click here to get started!

Cloud Build直接内置在Unity中。 点击这里开始!

翻译自: https://blogs.unity3d.com/2017/10/10/git-lfs-support-in-cloud-build/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值