Cleaning Up Unreferenced Files from a Git LFD Repository
Use this command to clean up a Git LFS repository. This command deletes all files from a Git LFS repository in Artifactory that are no longer referenced in a corresponding Git repository.
Commands Params
Parameter | Command / Description |
|---|---|
Command name |
|
Abbreviation |
|
Command options: | |
| [Optional] Server ID configured using the |
| [Default: refs/remotes/*] List of comma-separated Git references in the form of "ref1,ref2,..." which should be preserved. |
| [Optional] Local Git LFS repository in Artifactory which should be cleaned. If omitted, the repository is detected from the Git repository. |
| [Default: Set to |
| [Default: If |
| [Default: Set to |
| [Default: Number of HTTP retries. |
| [Default: Number of seconds or milliseconds to wait between retries. The numeric value should either end with |
Command arguments: | If no arguments are passed in, the command assumes the .git repository is located at current directory. |
path to .git | Path to the directory which includes the .git directory. |
Cleaning Up Unreferenced Files Examples
Example 1: Clean Up Using the Current Directory
This example cleans up Git LFS files from Artifactory, using the configuration from the .git directory located in the current directory.
jf rt glc
Example 2: Clean Up Using a Specific Path
This example cleans up Git LFS files from Artifactory, using the configuration from the .git directory located inside the path/to/git/config directory.
jf rt glc path/to/git/config
Example 3: Dry Run to Preview Deletions
This example simulates the cleanup without actually deleting any files, allowing you to preview what would be removed.
jf rt glc --dry-run
Example 4: Clean Up with Specific Repository
This example cleans up a specific Git LFS repository in Artifactory.
jf rt glc --repo=my-gitlfs-repo
Example 5: Clean Up with Custom Refs
This example preserves files referenced by HEAD and all remote branches.
jf rt glc --refs=HEAD,refs/remotes/*
Example 6: Quiet Mode for CI/CD Pipelines
This example runs the cleanup without confirmation prompts, suitable for automated pipelines.
jf rt glc --quiet --repo=my-gitlfs-repo
Example 7: With Retry Configuration
This example configures retry behavior for unreliable network connections.
jf rt glc --retries=5 --retry-wait-time=10sUpdated 2 months ago
