From 15a147e61898d25ec8b539190e87f3a09592c9c8 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 9 Feb 2011 20:54:02 -0500 Subject: rebase: use @{upstream} if no upstream specified 'git rebase' without arguments is currently not supported. Make it default to 'git rebase @{upstream}'. That is also what 'git pull [--rebase]' defaults to, so it only makes sense that 'git rebase' defaults to the same thing. Defaulting to @{upstream} will make it possible to run e.g. 'git rebase -i' without arguments, which is probably a quite common use case. It also improves the scenario where you have multiple branches that rebase against a remote-tracking branch, where you currently have to choose between the extra network delay of 'git pull' or the slightly awkward keys to enter 'git rebase @{u}'. The error reporting when no upstream is configured for the current branch or when no branch is checked out is reused from git-pull.sh. A function is extracted into git-parse-remote.sh for this purpose. Helped-by: Yann Dirson Helped-by: Jonathan Nieder Signed-off-by: Martin von Zweigbergk Signed-off-by: Junio C Hamano --- Documentation/git-rebase.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Documentation/git-rebase.txt') diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 96680c8456..d3e998df46 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git rebase' [-i | --interactive] [options] [--onto ] - [] + [] [] 'git rebase' [-i | --interactive] [options] --onto --root [] @@ -21,6 +21,12 @@ If is specified, 'git rebase' will perform an automatic `git checkout ` before doing anything else. Otherwise it remains on the current branch. +If is not specified, the upstream configured in +branch..remote and branch..merge options will be used; see +linkgit:git-config[1] for details. If you are currently not on any +branch or if the current branch does not have a configured upstream, +the rebase will abort. + All changes made by commits in the current branch but that are not in are saved to a temporary area. This is the same set of commits that would be shown by `git log ..HEAD` (or @@ -216,7 +222,8 @@ leave out at most one of A and B, in which case it defaults to HEAD. :: Upstream branch to compare against. May be any valid commit, - not just an existing branch name. + not just an existing branch name. Defaults to the configured + upstream for the current branch. :: Working branch; defaults to HEAD. -- cgit v1.2.3