源代码管理
默认情况下,public 文件夹会被添加到 .gitignore 文件中。这意味着你的录音不会存储在 Git 中。
视频会保存在本地,只有对代码的更改可以被暂存。
🌐 By default the public folder is added to the .gitignore file. This means your recordings are not stored in Git.
The videos are being kept locally and only changes to the code can be staged.
我们将此设置为默认,因为 GitHub 不允许超过 1GB 的仓库,并且你可能很快就会遇到错误。
🌐 We set this as default because GitHub does not allow repositores bigger than 1GB and you may run into an error quickly.
启用 Git LFS 存储
🌐 Enable Git LFS storage
我们自己使用 Git LFS,并建议设置它。
如果你想把所有录音添加到你的仓库中,你可以使用 Git LFS。
🌐 If you want to add all your recordings to your repository, you can use Git LFS.
你的 Git 提供商可能会对存储收费。 GitHub 账户包括 1 GiB 的免费存储和每月 1 GiB 的免费带宽。 之后,你可以花 5 美元购买 50GB 数据包。
🌐 Your Git provider might charge you for storage.
A GitHub account includes 1 GiB of free storage and 1 GiB a month of free bandwidth.
Afterwards, you can buy a 50GB data pack for $5.
1. 跟踪公共文件夹
🌐 1. Track public folder
注释掉 .gitignore 中忽略 public 文件夹的那一行:
🌐 Comment the line in .gitignore that ignores the public folder:
Comment out this line- public/**/*.{mp4,webm,mov} + # public/**/*.{mp4,webm,mov}
2. 设置 Git LFS
🌐 2. Setup Git LFS
- 下载 Git LFS。
- 在你的仓库中初始化 Git LFS:
git lfs install- 配置 Git LFS 来追踪 /public 及其所有子文件夹中的所有 .mp4 文件:
git lfs track public/**/*.mp43. 提交并推送
🌐 3. Commit and push
git add .gitattributes
git add public
git commit -m "Enable Git LFS"
git push