I've seen numerous guides on how to push large files to github, but not how to push a large amount of files.
I have a folder on my desktop that has 600 MB worth of text files that I need to push to a github repository.
I can't upload them directly b/c they exceed github's limitations. I have also tried to upload them from git bash:
$ git init
$ git add .
$ git commit -m “First commit”
$ git remote add origin remote repository URL
$ git push origin master
But this doesn't run, and even if it did, I believe it would just upload all of the files directly into the repository.
Ideally, I have a repository with a separate folder inside of it, and I need to push all 600 MB worth of files into this folder.
Please let me know how I can best go about achieving this!
Consider using Git LFS which stores the large files, usually used for binary files, in a folder away from the repository.
A link is included below,
https://docs.github.com/en/free-pro-team@latest/github/managing-large-files/versioning-large-files
Open terminal on the same project directory write
$ git lfs install
Git LFS will be initialized, after that command.
Track the file by using this command, for example your large file is a gif file.
$ git lfs track "*.gif"
Tracking "*.gif"
$ git add .gitattributes
Then add the files you need to commit, for example.
$ git add public/assets/sample.gif
Then commit
$ git commit -m "Added large file"
For instance you are in the master branch
$ git push origin master
Reference: https://guide.ncloud-docs.com/docs/en/sourcecommit-use-lfs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With