Tech Share
00中文日志
Random
🗒️Game Jam 101: 用GitHub进行Unity工程文件版本备份
type
status
date
slug
summary
tags
category
icon
password
这是一篇快速的使用GitHub使用“云存档”的教程:
【需要提前的工具】
- GitHub 账号 https://github.com/
- GitHub Desktop https://desktop.github.com/
- Unity 工程文件

Step 1 登录 (如果你第一次使用GitHub Desktop)

没有仓库链接?可以创建一个 → 参考 Step 2A (文章最后)
Step 2 克隆仓库 Clone Repository (如果你已有仓库链接)

Step 3 输入仓库链接 URL → link

Step 4 Pull & Fetch Origin 拉取云存档

Step 5 Save and Commit 保存并注释你的存档

🤗 Step 2A: 创建新仓库 Create a New Repository
进入https://github.com/网页主页,左上角创建

或者直接访问这个链接 → https://github.com/new
Step 3A: 配置用于Unity工程文件的新仓库

- 填写名称 Fill in the name
- 设置该仓库为“私人” Set it to Private
- 添加 .gitgnore 文件 → Unity (可以搜索Unity) Search Unity and select it

- 如果是公开仓库,需要License,建议使用 MIT License

- 网页右下角”Create Repository” 创建仓库

Step 4A: 添加合作者 Add Collaborators
- 创建成功后,你可以在这个仓库的主页发现”Settings”界面

- 选择Collaborators
- 选择 Add People

- 输入对方的邮箱或者账户名称

🎉 创建成功,也成功添加了你的合作者!
Step 5A: 从已有的Unity 工程文件上传的准备
新建Unity 工程文件,如果你还没有

如果Unity文件和GitHub上的仓库repository名称一样,并且存放在同一位置会出错。
如果你已经有Unity 工程文件,还没有repository,那么回到Step 2 克隆仓库 Clone Repository
- 找到你的Unity本地文件夹 Unity 文件选中 → 右键在文件夹里打开

- 打开GitHub仓库的本地文件夹

GitHub本地仓库可以在GitHub Desktop右边的界面打开(Mac 应该是另一个名称)

- 全选Unity本地文件夹,剪切全部文件
- 粘贴到新的仓库中
Step 6A: 在GitHub Desktop中上传Unity工程文件
打开你的GitHub Desktop,保存,注释,上传
重复步骤Step 5 Save and Commit 保存并注释你的存档
Last update: 2024-03-26