pub struct CheckoutArgs {
pub base: bool,
pub ours: bool,
pub theirs: bool,
pub to: Option<String>,
pub paths: Vec<String>,
}Expand description
Populate working copy with real content from Git LFS files.
Try to ensure that the working copy contains file content for Git LFS objects for the current ref, if the object data is available. Does not download any content; see git-lfs-fetch(1) for that.
Checkout scans the current ref for all LFS objects that would be required, then where a file is either missing in the working copy, or contains placeholder pointer content with the same SHA, the real file content is written, provided we have it in the local store. Modified files are never overwritten.
One or more may be provided as arguments to restrict the set of files that are updated. Glob patterns are matched as per the format described in gitignore(5).
When used with --to and the working tree is in a conflicted state due
to a merge, this option checks out one of the three stages a conflicting
Git LFS object into a separate file (which can be outside of the work
tree). This can make using diff tools to inspect and resolve merges
easier. A single Git LFS object’s file path must be provided in
PATHS. If FILE already exists, whether as a regular
file, symbolic link, or directory, it will be removed and replaced, unless
it is a non-empty directory or otherwise cannot be deleted.
If the installed Git version is at least 2.42.0,
this command will by default check out Git LFS objects for files
only if they are present in the Git index and if they match a Git LFS
filter attribute from a .gitattributes file that is present in either
the index or the current working tree (or, as is always the case, if
they match a Git LFS filter attribute in a local gitattributes file
such as $GIT_DIR/info/attributes). These constraints do not apply
with prior versions of Git.
In a repository with a partial clone or sparse checkout, it is therefore
advisable to check out all .gitattributes files from HEAD before
using this command, if Git v2.42.0 or later is installed. Alternatively,
the GIT_ATTR_SOURCE environment variable may be set to HEAD, which
will cause Git to only read attributes from .gitattributes files in
HEAD and ignore those in the index or working tree.
In a bare repository, this command prints an informational message and exits without modifying anything. In a future version, it may exit with an error.
Fields§
§base: boolCheck out the merge base of the specified file
ours: boolCheck out our side (that of the current branch) of the conflict for the specified file
theirs: boolCheck out their side (that of the other branch) of the conflict for the specified file
to: Option<String>If the working tree is in a conflicted state, check out the
portion of the conflict specified by --base, --ours, or
--theirs to the given path. Exactly one of these options
is required.
paths: Vec<String>Paths to check out.
When empty, everything in HEAD’s tree is checked out. In
conflict mode (--to <path> together with one of --base,
--ours, or --theirs), exactly one path is required.
Trait Implementations§
Source§impl Args for CheckoutArgs
impl Args for CheckoutArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for CheckoutArgs
impl FromArgMatches for CheckoutArgs
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(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.