git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Git Mailing list <git@vger.kernel.org>
Subject: is "git rebase ... [branch]" equivalent to first "git checkout [branch]"?
Date: Mon, 4 Mar 2019 15:41:16 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.21.1903041536460.12447@localhost.localdomain> (raw)


  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
========================================================================


             reply	other threads:[~2019-03-04 20:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 20:41 Robert P. J. Day [this message]
2019-03-04 22:54 ` is "git rebase ... [branch]" equivalent to first "git checkout [branch]"? Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.21.1903041536460.12447@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).