How to Upload / Push large files in GitHub Using Terminal.

How to Upload / Push large files in GitHub Using Terminal.

Let Me introduce you a new tool of Git that is "Git-Lfs"

Table of contents

No heading

No headings in the article.

What is Git-Lfs ?

Ans : Git LFS is a Git extension that allows you to manage large files in your Git repository by replacing them with text pointers that store metadata about the files in a separate location, making it easier to store and manage large files in Git.

How Does Git-Lfs Works ?

Ans : Git LFS works by replacing large files in your Git repository with text pointers that contain metadata, sending the actual files to a remote server or cloud storage system, and retrieving them when needed. It supports various remote storage options and requires installing the Git LFS client, configuring Git to use it, and tracking large files in your repository using Git LFS commands.

Explain Peocedure of Git-Lfs ?

Ans : Install Git LFS: You need to install the Git LFS command-line client on your local machine.

Initialize Git LFS: After installing Git LFS, you need to initialize it in your Git repository by running the following command: git lfs install

Track Large Files: You need to specify which files in your Git repository are large files and should be tracked by Git LFS. You can do this by adding file extensions or custom rules to a .gitattributes file in your repository. For example, you can track all .mp4 files using the following line in your .gitattributes file: *.mp4 filter=lfs diff=lfs merge=lfs -text

Add and Commit Large Files: You can add large files to your Git repository using the regular git add command. When you commit the changes, Git LFS replaces the large files with Git LFS pointers in the commit.

Push and Pull Changes: When you push changes to the remote repository, Git LFS sends the actual large files to the remote server or cloud storage system, while the Git LFS pointers remain in your repository. When you or other collaborators pull changes from the repository, Git LFS retrieves the large files from the remote server or cloud storage system and replaces the Git LFS pointers with the actual files in your working directory.

Manage Large Files: You can manage large files in your Git repository using Git LFS commands, such as git lfs ls-files to list the tracked large files, git lfs status to check the status of Git LFS pointers, and git lfs pull to manually download large files.

lets see the Steps to Install And Configure Git-Lfs And Upload / Push A Large File In Github Through Terminal . I am Using Ubuntu Terminal.

Uploading large files from Gitbash to Github

Step 1 : clone the existing repository

git clone https://github.com/shivarajkonnur297/fcr2.git

Step 2 : download and extract git-lfs setup file Download link :

Edit this texthttp://arfc.github.io/manual/guides/git-lfs

tar -xf git-lfs-linux-amd64-v2.9.0.tar.gz

give executable permission to shell script

chmod 755 install.sh

execute shell script

sudo ./install.sh

install git lfs

git lfs install

configure git lfs

git lfs update –manual git lfs update –force

track files to git lfs

git lfs track "filename.extension"

adding file to staging area

git add filename.extension git commit –m “added large file”

pushing to the git remote repository.

git push origin master