git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Documentation: A...B shortcut for checkout and rebase

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jun 1, 2010, 15:16 UTC
Message-ID
<380480a004c2d5f80ba96324562172f3b2b42f3e.1275405181.git.git@drmicha.warpmail.net>

Describe the A...B shortcuts for checkout and rebase [-i] which were introduced in these commits:

619a64e ("checkout A...B" switches to the merge base between A and B, 2009-10-18) 61dfa1b ("rebase --onto A...B" replays history on the merge base between A and B, 2009-11-20) 230a456 (rebase -i: teach --onto A...B syntax, 2010-01-07)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
The style in the two hunks is different so that it matches the surrounding
text. Talking about a style guide...
 Documentation/git-checkout.txt |    4 ++++
 Documentation/git-rebase.txt   |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index 4505eb6..afda5c3 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -154,6 +154,10 @@ edits from your current working tree.
 As a special case, the `"@\{-N\}"` syntax for the N-th last branch
 checks out the branch (instead of detaching).  You may also specify
 `-` which is synonymous with `"@\{-1\}"`.
++
+As a further 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`.
 
 <new_branch>::
 	Name for the new branch.
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 5863dec..50ba2e4 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -206,6 +206,10 @@ OPTIONS
 	--onto option is not specified, the starting point is
 	<upstream>.  May be any valid commit, and not just an
 	existing branch name.
++
+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.
 
 <upstream>::
 	Upstream branch to compare against.  May be any valid commit,
-- 
1.7.1.351.ge2633e
Message 1 of 1 in “Documentation: A...B shortcut for checkout and rebase”
  1. Documentation: A...B shortcut for checkout and rebaseMichael J Gruber, Jun 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.