diff --git a/git_new_branch.py b/git_new_branch.py index 105da17d00..d61a42d790 100755 --- a/git_new_branch.py +++ b/git_new_branch.py @@ -58,8 +58,7 @@ def main(args): else: # TODO(iannucci): Detect unclean workdir then stash+pop if we need to # teleport to a conflicting portion of history? - run('checkout', '-b', opts.branch_name) - run('branch', '--set-upstream-to', opts.upstream) + run('checkout', '--track', opts.upstream, '-b', opts.branch_name) get_or_create_merge_base(opts.branch_name) except subprocess2.CalledProcessError as cpe: sys.stdout.write(cpe.stdout) diff --git a/man/html/git-new-branch.html b/man/html/git-new-branch.html index d4c645695b..4f11776820 100644 --- a/man/html/git-new-branch.html +++ b/man/html/git-new-branch.html @@ -766,9 +766,9 @@ git-new-branch(1) Manual Page
Creates a new branch for HEAD. By default the new branch will track the -configured upstream for the repo (defaults to origin/master). If one of the -other options is specified, it will track that other ref instead.
Creates a new branch. By default the new branch will track the configured +upstream for the repo (defaults to origin/master). If one of the other options +is specified, it will track that other ref instead.