From 6183d826ba62ec94ccfcb8f6e3b8d43e3e338703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 20 Aug 2012 15:47:38 +0200 Subject: branch: introduce --set-upstream-to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing --set-uptream option can cause confusion, as it uses the usual branch convention of assuming a starting point of HEAD if none is specified, causing git branch --set-upstream origin/master to create a new local branch 'origin/master' that tracks the current branch. As --set-upstream already exists, we can't simply change its behaviour. To work around this, introduce --set-upstream-to which accepts a compulsory argument indicating what the new upstream branch should be and one optinal argument indicating which branch to change, defaulting to HEAD. The new options allows us to type git branch --set-upstream-to origin/master to set the current branch's upstream to be origin's master. Signed-off-by: Carlos Martín Nieto Signed-off-by: Junio C Hamano --- Documentation/git-branch.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 47235bea04..e41c4b55fd 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -13,6 +13,7 @@ SYNOPSIS [--column[=] | --no-column] [(--merged | --no-merged | --contains) []] [...] 'git branch' [--set-upstream | --track | --no-track] [-l] [-f] [] +'git branch' (--set-upstream-to= | -u ) [] 'git branch' (-m | -M) [] 'git branch' (-d | -D) [-r] ... 'git branch' --edit-description [] @@ -48,7 +49,7 @@ branch so that 'git pull' will appropriately merge from the remote-tracking branch. This behavior may be changed via the global `branch.autosetupmerge` configuration flag. That setting can be overridden by using the `--track` and `--no-track` options, and -changed later using `git branch --set-upstream`. +changed later using `git branch --set-upstream-to`. With a `-m` or `-M` option, will be renamed to . If had a corresponding reflog, it is renamed to match @@ -173,6 +174,12 @@ start-point is either a local or remote-tracking branch. like `--track` would when creating the branch, except that where branch points to is not changed. +-u :: +--set-upstream-to=:: + Set up 's tracking information so is + considered 's upstream branch. If no + is specified, then it defaults to the current branch. + --edit-description:: Open an editor and edit the text to explain what the branch is for, to be used by various other commands (e.g. `request-pull`). -- cgit v1.2.3 From b84869ef14081b298a4ab825219221ccfcb2a3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Thu, 30 Aug 2012 19:23:12 +0200 Subject: branch: add --unset-upstream option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have ways of setting the upstream information, but if we want to unset it, we need to resort to modifying the configuration manually. Teach branch an --unset-upstream option that unsets this information. Signed-off-by: Carlos Martín Nieto Signed-off-by: Junio C Hamano --- Documentation/git-branch.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index e41c4b55fd..9c1d2f1781 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -14,6 +14,7 @@ SYNOPSIS [(--merged | --no-merged | --contains) []] [...] 'git branch' [--set-upstream | --track | --no-track] [-l] [-f] [] 'git branch' (--set-upstream-to= | -u ) [] +'git branch' --unset-upstream [] 'git branch' (-m | -M) [] 'git branch' (-d | -D) [-r] ... 'git branch' --edit-description [] @@ -180,6 +181,10 @@ start-point is either a local or remote-tracking branch. considered 's upstream branch. If no is specified, then it defaults to the current branch. +--unset-upstream:: + Remove the upstream information for . If no branch + is specified it defaults to the current branch. + --edit-description:: Open an editor and edit the text to explain what the branch is for, to be used by various other commands (e.g. `request-pull`). -- cgit v1.2.3