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
- 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
- Hash
- Indicator
- *
- Full Object
- –
- LFS Pointer
- *
- 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
- Hash
- Indicator
- *
- Full Object
- –
- LFS Pointer
- *
- 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
- Hash
- Indicator
- *
- Full Object
- –
- LFS Pointer
- *
- File Name
- File Size
References
- Git
- Git-Lfs
- git-lfs-ls-files(1) — Show information about Git LFS files in the index and working tree
Link
- git-lfs-ls-files(1) — Show information about Git LFS files in the index and working tree
- Git-Lfs