git/list[1] front-page[2] threads[3] people[4] search[5] about
 

is "git rebase ... [branch]" equivalent to first "git checkout [branch]"?

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Mar 4, 2019, 20:41 UTC
Message-ID
<alpine.LFD.2.21.1903041536460.12447@localhost.localdomain>
  i *think* i know the answer to this based on man page and reading
the code, but i just want to verify that i'm not missing any subtlety.
  according to "man git-rebase":
   git rebase [-i | --interactive] [<options>] [--exec <cmd>]
       [--onto <newbase>]
       [<upstream> [<branch>]]
and:
  "If <branch> is specified, git rebase will perform an automatic git
checkout <branch> before doing anything else. Otherwise it remains on
the current branch."
  is it *absolutely* equivalent to either specify the final "[branch]"
argument on "git rebase", or to just "git checkout branch" first
before running the rebase, then leaving off that final argument?
  everything i've seen suggests those two things are identical, but
i've been fooled before.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Next: Junio C Hamano
Message 1 of 2 in “is "git rebase ... [branch]" equivalent to first "git checkout [branch]"?”
  1. Robert P. J. DayMar 4, 2019
  2. Junio C HamanoMar 4, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.