pub enum Command {
Show 28 variants
Clean {
path: Option<PathBuf>,
},
Smudge {
path: Option<PathBuf>,
skip: bool,
},
Install {
local: bool,
force: bool,
skip_repo: bool,
skip_smudge: bool,
},
Uninstall {
local: bool,
skip_repo: bool,
},
Track {
patterns: Vec<String>,
lockable: bool,
not_lockable: bool,
dry_run: bool,
verbose: bool,
json: bool,
no_excluded: bool,
filename: bool,
},
Untrack {
patterns: Vec<String>,
},
FilterProcess {
skip: bool,
},
Fetch {
args: Vec<String>,
dry_run: bool,
json: bool,
all: bool,
refetch: bool,
stdin: bool,
prune: bool,
include: Vec<String>,
exclude: Vec<String>,
},
Pull {
refs: Vec<String>,
include: Vec<String>,
exclude: Vec<String>,
},
Push {
remote: String,
args: Vec<String>,
dry_run: bool,
all: bool,
stdin: bool,
object_id: bool,
},
Clone {
args: Vec<String>,
},
PostCheckout {
args: Vec<String>,
},
PostCommit {
args: Vec<String>,
},
PostMerge {
args: Vec<String>,
},
PrePush {
remote: String,
url: Option<String>,
dry_run: bool,
},
Version,
Pointer {
file: Option<PathBuf>,
pointer: Option<PathBuf>,
stdin: bool,
check: bool,
strict: bool,
no_strict: bool,
},
Env,
Ext,
Migrate {
cmd: MigrateCmd,
},
Checkout {
paths: Vec<String>,
to: Option<String>,
ours: bool,
theirs: bool,
base: bool,
},
Prune {
dry_run: bool,
verbose: bool,
},
Fsck {
refspec: Option<String>,
objects: bool,
pointers: bool,
dry_run: bool,
},
Status {
porcelain: bool,
json: bool,
},
Lock {
paths: Vec<String>,
remote: Option<String>,
refspec: Option<String>,
json: bool,
},
Locks {
remote: Option<String>,
path: Option<String>,
id: Option<String>,
limit: Option<u32>,
refspec: Option<String>,
verify: bool,
json: bool,
},
Unlock {
paths: Vec<String>,
id: Option<String>,
force: bool,
remote: Option<String>,
refspec: Option<String>,
json: bool,
},
LsFiles {
refspec: Option<String>,
long: bool,
size: bool,
name_only: bool,
all: bool,
debug: bool,
json: bool,
},
}Variants§
Clean
Run the clean filter: read content on stdin, write a pointer on stdout.
Fields
Smudge
Run the smudge filter: read a pointer on stdin, write content on stdout.
Fields
Install
Configure git to invoke git-lfs as the clean/smudge/process filter, and install the LFS git hooks.
Fields
Uninstall
Reverse of install: clear the filter.lfs.* config and remove
the LFS git hooks. Hooks that don’t match what we’d write are left
untouched.
Fields
Track
Track a file pattern with git-lfs by adding it to .gitattributes. With no patterns, lists currently-tracked patterns.
Fields
Untrack
Stop tracking a file pattern with git-lfs by removing it from .gitattributes. The matching pointer files in history (and the objects in the local store) are left in place.
FilterProcess
Run the long-running filter-process protocol with git over stdin/stdout.
This is what git invokes via filter.lfs.process and is the batched
alternative to per-invocation clean/smudge.
Fields
Fetch
Download every LFS object reachable from the given refs (default: HEAD) that isn’t already in the local store. Walks history, dedupes by OID.
Fields
args: Vec<String>First positional arg is treated as a remote name (if it resolves); subsequent args are refs.
dry_run: boolList the objects that would be fetched without downloading
them (one fetch <oid> => <path> line per object).
json: boolJSON output. With --dry-run, queries the server’s batch
endpoint to populate actions URLs.
Pull
fetch then re-run the smudge filter so the working tree contains
real LFS file contents instead of pointer text. Requires
git lfs install to have wired up the smudge filter.
Fields
Push
Upload every LFS object reachable from the given refs that the
remote doesn’t already have. The “doesn’t have” set is approximated
by refs/remotes/<remote>/*; the LFS server’s batch API also
dedupes server-side so missing exclusions don’t waste bandwidth.
Fields
remote: StringName of the remote (e.g. “origin”) whose tracking refs are excluded from the upload set.
args: Vec<String>Refs (or, with --object-id, raw OIDs) to push. With
--all, restricts the all-refs walk to these; with
--stdin, ignored (a warning is emitted).
dry_run: boolList the objects that would be pushed without actually
uploading them (one push <oid> => <path> line per object).
all: boolPush every local ref under refs/heads/* and refs/tags/*
(intersected with args if any are given).
Clone
Deprecated. Wraps git clone so the working tree is populated
with pointer text first, then runs git lfs pull to download
LFS content in batch. Modern git clone parallelizes the
smudge filter and is no slower; prefer it.
Fields
PostCheckout
Git post-checkout hook entry point. Receives <prev-sha> <post-sha> <flag> (flag is “1” if HEAD moved). Currently a
no-op stub — exists so installed hook scripts don’t fail. Real
behavior arrives with track --lockable.
PostCommit
Git post-commit hook entry point. No arguments. Currently a no-op stub.
PostMerge
Git post-merge hook entry point. Receives <squash-flag>.
Currently a no-op stub.
PrePush
Git pre-push hook entry point — not typically invoked by hand.
Reads <local-ref> <local-sha> <remote-ref> <remote-sha> lines
from stdin and uploads the LFS objects newly reachable from each
<local-sha>.
Fields
Version
Print the git-lfs version and exit.
Pointer
Debug helper: build a pointer from a file, parse one from disk or stdin, or just check whether some bytes are a valid pointer.
Fields
Env
Show the LFS environment: version, endpoints, on-disk paths, and
the three filter.lfs.* config values.
Ext
List the configured LFS pointer extensions (lfs.extension.<name>.*).
Extensions chain external clean/smudge programs around each LFS
object; this prints their resolved configuration in priority order.
Migrate
Analyze or rewrite history for LFS conversion. Phase 1 ships
info only; import and export will land in subsequent phases.
Fields
cmd: MigrateCmdCheckout
Replace pointer text in the working tree with actual LFS object content. With no args, materializes every LFS pointer in HEAD’s tree. With paths (literal file names or trailing-slash directory prefixes), restricts to matching pointers.
During a merge conflict, --to <path> --ours/--theirs/--base <file> writes the LFS content from one of the conflicted
stages to <path> (creating intermediate directories) so the
user can compare or salvage versions.
Fields
paths: Vec<String>Paths to check out. Empty = everything in HEAD’s tree.
In conflict mode (--to), exactly one path is required.
to: Option<String>Conflict-mode: write the chosen stage’s content to this path instead of into the working tree. Resolves relative to the current directory.
Prune
Delete local LFS objects that aren’t reachable from HEAD or any unpushed commit. Reclaims disk for repos whose history has moved past their objects.
Fields
Fsck
Check the integrity of LFS objects and pointers reachable from
<refspec> (default: HEAD). Exit 1 if anything is corrupt.
Fields
Status
Show staged + unstaged changes, classifying each blob as LFS, Git, or working-tree File.
Fields
Lock
Acquire an exclusive server-side lock on one or more files. Other users will be unable to push changes to a locked file.
Fields
Locks
List file locks held on the server.
Fields
Unlock
Release a file lock previously acquired with git lfs lock.
Either provide one or more paths, or --id <id> (mutually
exclusive).
Fields
LsFiles
List LFS-tracked files visible at a ref (default: HEAD), or across
all reachable history with --all.
Fields
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand