Git – Large File Support ( LFS ) – List Files

Background

Let us continue to explore Git’s support for Large Files ( LFS ).

In this post, we will identify the files that are tagged “large files“.

 

Git

Git Command

git lfs ls-files

The command that we will use is “git lfs ls-files“.

Options

Option Usage
Depth
–deleted Shows the full history of the given reference, including objects that have been deleted.
-a, –all Shows the full history of the repository
Breath
-s, –size The file size is included in the output
-n –name-only Only the file name is shown

Syntax


git lfs ls-files

Sample

List Current Large Files

git lfs ls-files

Output – Image

Output – Textual

git lfs ls-files
528397cf37 * Database/Backup/sales.bak

Explanation
  1. Indicator
    • *
      • Full Object

 

List Current and Deleted Large Files

git lfs ls-files --deleted

Output – Image

Output – Textual

>git lfs ls-files --deleted
528397cf37 * Database/Backup/sales.bak
e3b0c44298 - SourceCode/log4net.xml

Explanation
  1. Hash
  2. Indicator
    • *
      • Full Object
      • LFS Pointer
  3. File Name

 

List Full History Large Files

git lfs ls-files --all

Output – Image

Output – Textual

528397cf37 * Database/Backup/Sales.bak
e3b0c44298 - SourceCode/log4net.xml

Explanation
  1. Hash
  2. Indicator
    • *
      • Full Object
      • LFS Pointer
  3. File Name

 

List Current and Deleted Large Files ( include file sizes )

git lfs ls-files --deleted --size

Output – Image

Output – Textual

528397cf37 * Database/Backup/sales.bak (222 MB)
e3b0c44298 - SourceCode/log4net.xml (0 B)

Explanation
  1. Hash
  2. Indicator
    • *
      • Full Object
      • LFS Pointer
  3. File Name
  4. File Size

 

References

  1. Git
    • Git-Lfs
      • git-lfs-ls-files(1) — Show information about Git LFS files in the index and working tree
        Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s