Home Explore Blog CI



git

2nd chunk of `Documentation/git-restore.adoc`
b654074c86a60ebf329090a40a73e626251825bedfde01c800000001000008e0
 index, use
	stage #2 (`ours`) or #3 (`theirs`) for unmerged paths.
	This option cannot be used when checking out paths from a
	tree-ish (i.e. with the `--source` option).
+
Note that during `git rebase` and `git pull --rebase`, `ours` and
`theirs` may appear swapped. See the explanation of the same options
in linkgit:git-checkout[1] for details.

`-m`::
`--merge`::
	When restoring files on the working tree from the index,
	recreate the conflicted merge in the unmerged paths.
	This option cannot be used when checking out paths from a
	tree-ish (i.e. with the `--source` option).

`--conflict=<style>`::
	The same as `--merge` option above, but changes the way the
	conflicting hunks are presented, overriding the
	`merge.conflictStyle` configuration variable.  Possible values
	are `merge` (default), `diff3`, and `zdiff3`.

`--ignore-unmerged`::
	When restoring files on the working tree from the index, do
	not abort the operation if there are unmerged entries and
	neither `--ours`, `--theirs`, `--merge` or `--conflict` is
	specified. Unmerged paths on the working tree are left alone.

`--ignore-skip-worktree-bits`::
	In sparse checkout mode, the default is to only update entries
	matched by _<pathspec>_ and sparse patterns in
	`$GIT_DIR/info/sparse-checkout`. This option ignores the sparse
	patterns and unconditionally restores any files in
	_<pathspec>_.

`--recurse-submodules`::
`--no-recurse-submodules`::
	If _<pathspec>_ names an active submodule and the restore location
	includes the working tree, the submodule will only be updated if
	this option is given, in which case its working tree will be
	restored to the commit recorded in the superproject, and any local
	modifications overwritten. If nothing (or
	`--no-recurse-submodules`) is used, submodules working trees will
	not be updated. Just like linkgit:git-checkout[1], this will detach
	`HEAD` of the submodule.

`--overlay`::
`--no-overlay`::
	In overlay mode, never remove files when restoring. In no-overlay mode,
	remove tracked files that do not appear in the _<tree>_ of
	`--source=<tree>`, to make them match _<tree>_ exactly. The default
	is no-overlay mode.

`--pathspec-from-file=<file>`::
	Pathspec is passed in _<file>_ instead of commandline args. If
	_<file>_ is exactly `-`

Title: Git Restore Command Options
Summary
The git-restore command has various options to customize the restore process, including options for handling unmerged paths, conflicted merges, sparse checkouts, submodules, and file removal, allowing users to tailor the restore operation to their specific needs.