'How to use git lfs to push complete folder to github

I have a project folder in my local having Deep learning models inside it. I want to push it to GitHub by creating new repository.

Here are the steps that I have taken:

Went to my GitHub account and created New Repo with name DeepL_models and only selected ReadMe and Private repository.

Then I cloned this repo using:

git clone ssh_link

After this step I went inside this cloned folder and dragged and dropped my model folder inside it:

enter image description here

The commands that I type after this are:

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

But why I am getting Everything up-to-date?

To track the complete folder model :

git lfs track *


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

Locking support detected on remote "origin". Consider enabling it with:

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'

I have installed git lfs but still getting this error. Also I have been asked password many times?



Solution 1:[1]

I faced the same issue like you. After I did follow this guide and original guide, the bug is fixed. Please remove large files in git add . and redo:

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 M.Vu