]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Doc: document "A...B" form for <tree-ish> in checkout and switch
authorDenton Liu <liu.denton@gmail.com>
Wed, 7 Oct 2020 07:56:16 +0000 (00:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Oct 2020 16:49:05 +0000 (09:49 -0700)
Using "A...B" has been supported for the <tree-ish> argument for a
while. However, its support has never been explicitly documented.

Explicitly document it so that users know that it is available.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-checkout.txt
Documentation/git-restore.txt

index 5b697eee1b7632a046b48d488b3c3af75ad7fa45..8c2f736f3a47ec8f0194e8181b75a05cbb0fcbdf 100644 (file)
@@ -350,6 +350,10 @@ leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 <tree-ish>::
        Tree to checkout from (when paths are given). If not specified,
        the index will be used.
++
+As a special case, you may use `"A...B"` as a shortcut for the
+merge base of `A` and `B` if there is exactly one merge base. You can
+leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 
 \--::
        Do not interpret any more arguments as options.
index 84c6c400109851ac34185a4f9004aada07aa79aa..55bde91ef9e54be6c9ecf928f6f72c775b45809a 100644 (file)
@@ -40,6 +40,10 @@ OPTIONS
 +
 If not specified, the contents are restored from `HEAD` if `--staged` is
 given, otherwise from the index.
++
+As a special case, you may use `"A...B"` as a shortcut for the
+merge base of `A` and `B` if there is exactly one merge base. You can
+leave out at most one of `A` and `B`, in which case it defaults to `HEAD`.
 
 -p::
 --patch::