From: Junio C Hamano Date: Sun, 19 May 2019 07:45:28 +0000 (+0900) Subject: Merge branch 'dl/branch-from-3dot-merge-base' X-Git-Tag: v2.22.0-rc1~26 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4ac8371a1ce0df07a2c3389d6acf6c35207a54fa?hp=-c 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 --- 4ac8371a1ce0df07a2c3389d6acf6c35207a54fa diff --combined Documentation/git-branch.txt index 0cd87ddeff,8719e4cab9..6ebd512b4f --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@@ -9,7 -9,7 +9,7 @@@ SYNOPSI -------- [verse] 'git branch' [--color[=] | --no-color] [-r | -a] - [--list] [-v [--abbrev= | --no-abbrev]] + [--list] [--show-current] [-v [--abbrev= | --no-abbrev]] [--column[=] | --no-column] [--sort=] [(--merged | --no-merged) []] [--contains []] @@@ -45,7 -45,11 +45,11 @@@ argument is missing it defaults to `HEA branch). The command's second form creates a new branch head named - which points to the current `HEAD`, or if given. + which points to the current `HEAD`, or if given. As a + special case, for , 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 " to switch to the @@@ -160,10 -164,6 +164,10 @@@ This option is only applicable in non-v branch --list 'maint-*'`, list only the branches that match the pattern(s). +--show-current:: + Print the name of the current branch. In detached HEAD state, + nothing is printed. + -v:: -vv:: --verbose:: diff --combined Documentation/git-checkout.txt index 877e5f503a,d32f2eb611..964f912d29 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@@ -242,8 -242,6 +242,8 @@@ should result in deletion of the path) + When checking out paths from the index, this option lets you recreate the conflicted merge in the specified paths. ++ +When switching branches with `--merge`, staged changes may be lost. --conflict=