如何使用 git lfs 将完整文件夹推送到 github

How to use git lfs to push complete folder to github

我本地有一个项目文件夹,里面有深度学习模型。我想通过创建新存储库将其推送到 GitHub

以下是我采取的步骤:

转到我的 GitHub 帐户并创建名为 DeepL_models 的新存储库,并且只选择了 ReadMePrivate 存储库。

然后我使用以下方法克隆了这个 repo:

git clone ssh_link

在这一步之后,我进入了这个 cloned folder 并将我的模型文件夹拖放到其中:

我之后输入的命令是:

pc@LM-BGL-40510 Model % git remote
origin
pc@LM-BGL-40510 Model % git branch
* master

git lfs install
Updated git hooks.
Git LFS initialized.

git push -u origin master
Branch master set up to track remote branch master from origin.
Everything up-to-date

但为什么我得到 Everything up-to-date

跟踪完整文件夹model :

git lfs track *


git commit -m "Adding Model"  
git push origin master

在远程“来源”上检测到锁定支持。考虑启用它:

Counting objects: 170, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (166/166), done.
Writing objects: 100% (170/170), 1.30 GiB | 1.88 MiB/s, done.
Total 170 (delta 99), reused 0 (delta 0)
remote: Resolving deltas: 100% (99/99), done.

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: File Model/exports/dl_model/flax_model.msgpack is 475.54 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB
remote: error: File Model/exports/dl_model/pytorch_model.bin is 475.57 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB
remote: error: File Model/exports/unbiased-toxic-roberta/pytorch_model.bin is 475.62 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB
remote: error: Please contact github_support@***.com
To github.****.pc/Model.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.***.pc/Sexually_Explicit.git'

我已经安装了 git lfs 但仍然出现此错误。 我也被问过很多次密码?

我遇到了和你一样的问题。在我关注了this guide and original guide之后,bug就修复了。 请删除 git 添加中的大文件。并重做:

git reset --hard
git lfs install
git lfs track "*.psd"
git add .gitattributes
git add file.psd
git commit -m "Add design file"
git push origin main