当没有参数时,命令“git rebase”是什么意思?

use*_*279 9 git

'git rebase' 应该至少有一个参数吗?'git rebase' 是什么意思?

Val*_*das 10

取自手册页 ( git help rebase):

   git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
           [<upstream>] [<branch>]
   git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
           --root [<branch>]
   git rebase --continue | --skip | --abort | --edit-todo

   If <branch> is specified, git rebase will perform an automatic git
   checkout <branch> before doing anything else. Otherwise it remains on
   the current branch.

   If <upstream> is not specified, the upstream configured in
   branch.<name>.remote and branch.<name>.merge options will be used; see
   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.
Run Code Online (Sandbox Code Playgroud)

这意味着git rebase,单独默认为git rebase branch.<name>.remote branch.<name>,只要已经存在为此分支配置的上游 - 否则,它会中止。

如果你只给它一个参数,它将是上游分支的名称,同时让你保持在原来的分支中。