Upload files greater than 100MB to GitHub

What if you want to upload more than 100MB?

This is where Git Large File Storage comes in.

  • Step 1: After downloading it from the link above, type git lfs isntall in your “Terminal” (once per user account)

  • Step 2: Go to the folder that has the files you want to upload, type this command

git lfs track "*.rds"

where you can rds to any file types of your choice (e.g., mp4, jpeg, zip, etc.)

if you want to commit multiple types then

git lfs track "*.jpg" "*.png" "*.mp4"

my usual go-to command is

git lfs track "*.csv" "*.xlsx" "*.rds" "*.sas7bdat" "*csv.gz" "*.CSV"

which will create a .gitattributes file

then, you need to track this file by

git add .gitattributes

Alternatively, you can also directly edit your .gitattributes file (but then you still need to add it: git add .gitattributes )


Then, you are done. You can proceed to commit and push to GitHub like usual.

Mike Nguyen, PhD
Mike Nguyen, PhD
Visiting Professor of Data Sciences and Operations

My research interests include marketing, and social science.

Next
Previous

Related