如果後面沒有參數,那麼指令「git rebase」代表什麼?

如果後面沒有參數,那麼指令「git rebase」代表什麼?

「git rebase」應該至少採用一個參數嗎? 「git rebase」是什麼意思?

答案1

摘自手冊頁 ( 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.

這意味著,只要該分支已經存在已配置的上游,則git rebase單獨預設為,否則它將中止。git rebase branch.<name>.remote branch.<name>

如果您只給它一個參數,它將是上游分支的名稱,同時使您保持在原來的分支中。

相關內容