diff --git a/man/html/git-new-branch.html b/man/html/git-new-branch.html index 3c3b154b1..7bb3cc1d2 100644 --- a/man/html/git-new-branch.html +++ b/man/html/git-new-branch.html @@ -758,7 +758,8 @@ git-new-branch(1) Manual Page
git new-branch <branch_name>
 git new-branch --upstream_current <branch_name>
 git new-branch --upstream <REF> <branch_name>
-git new-branch --lkgr <branch_name>
+git new-branch --lkgr <branch_name> +git new-branch --inject_current<branch_name>
@@ -807,6 +808,22 @@ new-branch --upstream_current <branch_name>.

+--inject_current +
+
+

+ Set the tracking (upstream) branch of the newly-created branch to the + tracking (upstream) branch of the currently-checked-out branch and set the + tracking (upstream) branch of the currently-checked-out branch to the + newly-created branch. +
+
+ Before: current > upstream +
+ After: current > new > upstream +

+
+
<branch_name>
@@ -875,12 +892,28 @@ Your branch is ahead of 'origin/master' by 4 commits. nested_cl fixit [ ahead 2 ] frozen_branch [ ahead 3 ] + independent_cl [ ahead 1 ] +$ git checkout subfeature +Switched to branch 'subfeature' +Your branch and 'cool_feature' have diverged, +and have 2 and 1 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) +$ git new-branch --inject_current injected_cl +$ git map-branches -v +origin/master + cool_feature [ ahead 4 ] <1> + cl_depends_on_cool_feature + injected_cl * + subfeature [ ahead 2 | behind 1 ] + nested_cl + fixit [ ahead 2 ] + frozen_branch [ ahead 3 ] independent_cl [ ahead 1 ]

  1. -Note that both branches are cyan because they are currently the same +Note that these branches are cyan because they are currently the same commit object. See git-map-branches(1) for more detail.

  2. @@ -926,7 +959,7 @@ by checking out the
diff --git a/man/man1/git-new-branch.1 b/man/man1/git-new-branch.1 index 6b9fc0440..4ce7ed03d 100644 --- a/man/man1/git-new-branch.1 +++ b/man/man1/git-new-branch.1 @@ -36,6 +36,7 @@ git-new-branch \- Create a new branch with correct tracking information\&. \fIgit new\-branch\fR \-\-upstream_current \fIgit new\-branch\fR \-\-upstream \fIgit new\-branch\fR \-\-lkgr +\fIgit new\-branch\fR \-\-inject_current .fi .sp .SH "DESCRIPTION" @@ -61,6 +62,17 @@ Alias for \-\-upstream lkgr\&. .RE .PP +\-\-inject_current +.RS 4 +Set the tracking (upstream) branch of the newly\-created branch to the tracking (upstream) branch of the currently\-checked\-out branch and set the tracking (upstream) branch of the currently\-checked\-out branch to the newly\-created branch\&. +.RE +.RS 4 +Before: current > upstream +.RE +.RS 4 +After: current > new > upstream +.RE +.PP .RS 4 The name for the new branch\&. @@ -122,6 +134,22 @@ origin/master fixit [ ahead 2 ] frozen_branch [ ahead 3 ] independent_cl [ ahead 1 ] +\fB$ git checkout subfeature\fR +Switched to branch \*(Aqsubfeature\*(Aq +Your branch and \*(Aqcool_feature\*(Aq have diverged, +and have 2 and 1 different commits each, respectively\&. + (use "git pull" to merge the remote branch into yours) +\fB$ git new\-branch \-\-inject_current injected_cl\fR +\fB$ git map\-branches \-v\fR +origin/master +\fB cool_feature [ ahead 4 ] \fR\fB\fB(1)\fR\fR\fB + cl_depends_on_cool_feature + injected_cl * +\fR subfeature [ ahead 2 | behind 1 ] + nested_cl + fixit [ ahead 2 ] + frozen_branch [ ahead 3 ] + independent_cl [ ahead 1 ] .fi .if n \{\ .RE @@ -137,7 +165,7 @@ origin/master .sp -1 .IP " 1." 4.2 .\} -Note that both branches are cyan because they are currently the same +Note that these branches are cyan because they are currently the same \fIcommit\fR object\&. See \fBgit-map-branches\fR(1) diff --git a/man/src/git-new-branch.demo.1.sh b/man/src/git-new-branch.demo.1.sh index d6e3c34e6..51502a6b7 100755 --- a/man/src/git-new-branch.demo.1.sh +++ b/man/src/git-new-branch.demo.1.sh @@ -15,3 +15,6 @@ run git map-branches -v run git checkout cool_feature 2>&1 run git new-branch --upstream_current cl_depends_on_cool_feature run git map-branches -v +run git checkout subfeature +run git new-branch --inject_current injected_cl +run git map-branches -v diff --git a/man/src/git-new-branch.txt b/man/src/git-new-branch.txt index c14823703..c3d50efe9 100644 --- a/man/src/git-new-branch.txt +++ b/man/src/git-new-branch.txt @@ -13,6 +13,7 @@ SYNOPSIS 'git new-branch' --upstream_current 'git new-branch' --upstream 'git new-branch' --lkgr +'git new-branch' --inject_current DESCRIPTION ----------- @@ -41,6 +42,15 @@ OPTIONS --lkgr:: Alias for `--upstream lkgr`. +--inject_current:: + Set the tracking (upstream) branch of the newly-created branch to the + tracking (upstream) branch of the currently-checked-out branch and set the + tracking (upstream) branch of the currently-checked-out branch to the + newly-created branch. + + Before: current > upstream + After: current > new > upstream + :: The name for the new branch. @@ -59,7 +69,7 @@ EXAMPLE ------- demo:1[] -1. Note that both branches are cyan because they are currently the same +1. Note that these branches are cyan because they are currently the same 'commit' object. See linkgit:git-map-branches[1] for more detail. include::_aliases.txt[]