You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Wiki/pages/如何将-Git-LFS-与-GitHub-桌面应用程序...

41 lines
4.1 KiB
Markdown

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 如何将 Git LFS 与 GitHub 桌面应用程序一起使用
下文属于机翻,如果需要看原文,请浏览 https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/documentation/how-to-use-git-lfs-with-github-desktop-app.md
面向非技术用户的 Git LFS 教程。
## [](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/documentation/how-to-use-git-lfs-with-github-desktop-app.md#download-github-desktop-app)下载 GitHub 桌面应用程序
访问 [GitHub Desktop 网站](https://desktop.github.com/)并下载适用于 macOS 或 Windows 的内容。
在您的计算机上安装该应用程序。
## [](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/documentation/how-to-use-git-lfs-with-github-desktop-app.md#access-the-vagov-team-repository)访问 va.gov 团队存储库
1. 选择**从互联网克隆存储库**
2. 在出现的弹出窗口 中,选择**“GitHub.com >登录**”`Clone a repository`
3. 使用您的 GitHub 用户名和密码登录
4. 使用 GitHub 桌面应用程序中的搜索栏,查找存储库。它将在组织(全名)下。 注意如果您没有看到组织您可能需要确认您实际上是组织的成员_您实际上不需要成为组织的成员即可访问和克隆 va.gov 团队存储库;它是一个公共存储库。_ [](https://github.com/orgs/department-of-veterans-affairs/people) `va.gov-team``department-of-veterans-afairs``department-of-veterans-affairs/va.gov-team``department-of-veterans-affairs`
5. 选择显示克隆**`退伍军人事务部/va.gov-team`** 的蓝色按钮
6. 选择要将存储库中的文件保存在计算机上的位置(**本地路径**),然后选择“**克隆”**
7. 等待存储库克隆到您的计算机 - 它很大!这需要一段时间!这就是为什么我们使用 Git LFS 来尽可能减少存储库的大小。
## [](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/documentation/how-to-use-git-lfs-with-github-desktop-app.md#initialize-git-lfs)初始化 Git LFS
1. 克隆存储库后,您应该会看到一个弹出窗口,上面写着`Initialize Git LFS`
2. 选择`Initialize Git LFS`
## [](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/documentation/how-to-use-git-lfs-with-github-desktop-app.md#make-sure-your-clone-of-the-repo-is-up-to-date)确保存储库的克隆是最新的
- 在 GitHub 桌面应用程序中,选择(在应用程序的顶部深灰色栏中)`Fetch origin`
- 如果存储库的克隆不同步,则会出现蓝色阴影警报 - 例如,如果它在 1 次提交时不同步,它将显示“从源远程拉取 1 个提交:当前分支(主分支)在 GitHub 上有一个提交,而您的计算机上不存在”
- 选择蓝色按钮`Pull origin`
## [](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/documentation/how-to-use-git-lfs-with-github-desktop-app.md#upload-your-file)上传您的文件
- 确保文件名正确(带短划线的小写),并将其拖到桌面上希望它位于 GitHub 中的文件夹中(打开存储库的桌面版本,然后在存储库中导航到桌面上的相应文件夹。存储库位于您告诉 GitHub Desktop 应用程序要保存它的任何位置。`va.gov-team`
- 在 GitHub 桌面应用程序中如果在“当前分支”设置为“master”时进行了此更改则应看到以下消息“将提交推送到源远程 - 您有 1 个本地提交等待推送到 GitHub”
- 点击蓝色的“推送原点”按钮
## [](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/documentation/how-to-use-git-lfs-with-github-desktop-app.md#more-info)更多信息
- [回购准则](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/working-with-vsp/orientation/repo-guidelines.md)
- 进一步解释[我们如何以及为什么使用 Git LFS](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/working-with-vsp/orientation/repo-guidelines.md#file-storage-and-large-files)