diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-05-19 09:45:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-19 09:45:28 +0200 |
commit | 4ac8371a1ce0df07a2c3389d6acf6c35207a54fa (patch) | |
tree | 0570de778821f4b158c6d7287843b906d68c5b33 /Documentation/git-branch.txt | |
parent | Merge branch 'js/commit-graph-parse-leakfix' (diff) | |
parent | branch: make create_branch accept a merge base rev (diff) | |
download | git-4ac8371a1ce0df07a2c3389d6acf6c35207a54fa.tar.xz git-4ac8371a1ce0df07a2c3389d6acf6c35207a54fa.zip |
Merge branch 'dl/branch-from-3dot-merge-base'
"git branch new A...B" and "git checkout -b new A...B" have been
taught that in their contexts, the notation A...B means "the merge
base between these two commits", just like "git checkout A...B"
detaches HEAD at that commit.
* dl/branch-from-3dot-merge-base:
branch: make create_branch accept a merge base rev
t2018: cleanup in current test
Diffstat (limited to 'Documentation/git-branch.txt')
-rw-r--r-- | Documentation/git-branch.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 0cd87ddeff..6ebd512b4f 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -45,7 +45,11 @@ argument is missing it defaults to `HEAD` (i.e. the tip of the current branch). The command's second form creates a new branch head named <branchname> -which points to the current `HEAD`, or <start-point> if given. +which points to the current `HEAD`, or <start-point> if given. As a +special case, for <start-point>, 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`. Note that this will create the new branch, but it will not switch the working tree to it; use "git checkout <newbranch>" to switch to the |