diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-07-31 15:44:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-31 16:10:54 -0700 |
commit | 54f98fee5069f50c6e96687504b82a7695c8648a (patch) | |
tree | 744883c40121a184bece4e5cffffb913ed29e0fa /Documentation/git-restore.txt | |
parent | c0a4ae7f4e010204f8341dcc3b9217dd42baee14 (diff) | |
download | git-54f98fee5069f50c6e96687504b82a7695c8648a.tar.gz |
checkout/restore: refuse unmerging paths unless checking out of the index
Recreating unmerged index entries using resolve-undo data,
recreating conflicted working tree files using unmerged index
entries, and writing data out of unmerged index entries, make
sense only when we are checking paths out of the index and not when
we are checking paths out of a tree-ish.
Add an extra check to make sure "--merge" and "--ours/--theirs"
options are rejected when checking out from a tree-ish, update the
document (especially the SYNOPSIS section) to highlight that they
are incompatible, and add a few tests to make sure the combination
fails.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-restore.txt')
-rw-r--r-- | Documentation/git-restore.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt index 5964810caa..c70444705b 100644 --- a/Documentation/git-restore.txt +++ b/Documentation/git-restore.txt @@ -78,6 +78,8 @@ all modified paths. --theirs:: When restoring files in the working tree from the 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 @@ -87,6 +89,8 @@ in linkgit:git-checkout[1] for details. --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 |