Search This Blog

Saturday 20 February 2021

How to upload a file larger than 25mb into github

 
Step 1) Download and install git-lfs

https://github.com/git-lfs/git-lfs/releases/download/v2.13.2/git-lfs-windows-v2.13.2.exe

pavankumar bandaru@DESKTOP-0V7CFI5 MINGW64 ~/jdk (master)

$ ls -lart

total 140388

drwxr-xr-x 1 pavankumar bandaru 197121         0 Feb 20 16:08 ../

drwxr-xr-x 1 pavankumar bandaru 197121         0 Feb 20 16:09 .git/

drwxr-xr-x 1 pavankumar bandaru 197121         0 Feb 20 16:09 ./

-rw-r--r-- 1 pavankumar bandaru 197121 143722924 Feb 20 16:09 jdk-8u281-linux-x64.tar.gz

Step 2) Once downloaded and installed, set up Git LFS for your user account by running:

pavankumar bandaru@DESKTOP-0V7CFI5 MINGW64 ~/Downloads (main)

$ git lfs install

Updated git hooks.

Git LFS initialized.

Step 3) In each Git repository where you want to use Git LFS, select the file types you'd like Git LFS to manage (or directly edit your .gitattributes). You can configure additional file extensions at anytime.

pavankumar bandaru@DESKTOP-0V7CFI5 MINGW64 ~/jdk (master)

$ git lfs track "*.gz"

Tracking "*.gz"


Now make sure .gitattributes is tracked:

pavankumar bandaru@DESKTOP-0V7CFI5 MINGW64 ~/Downloads (main)

$ git add .gitattributes

Step 4) Just commit and push to GitHub as you normally would; for instance, if your current branch is named main:

pavankumar bandaru@DESKTOP-0V7CFI5 MINGW64 ~/Downloads (master)

$ git add jdk-8u281-linux-x64.tar.gz

pavankumar bandaru@DESKTOP-0V7CFI5 MINGW64 ~/Downloads (master)

$ git commit -m "jdk8"
[master (root-commit) fac4ee2] jdk8
 2 files changed, 4 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 jdk-8u281-linux-x64.tar.gz

$ git push origin master
Username for 'https://github.com': pavanbandaru
Password for 'https://pavanbandaru@github.com':
Uploading LFS objects: 100% (1/1), 144 MB | 0 B/s, done.
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 424 bytes | 424.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote:      https://github.com/pavanbandaru/tomcat/pull/new/master
remote:
To https://github.com/pavanbandaru/tomcat.git/
 * [new branch]      master -> master

pavankumar bandaru@DESKTOP-0V7CFI5 MINGW64 ~/jdk8 (master)



No comments: