git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Carlos Martín Nieto" <cmn@elego.de>
To: Orgad and Raizel Shaneh <orgads@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git rebase -i does not rebase if all lines are removed
Date: Tue, 17 Jul 2012 12:55:35 +0200	[thread overview]
Message-ID: <1342522535.20671.7.camel@centaur.cmartin.tk> (raw)
In-Reply-To: <CAGHpTBKn+avCrWegktoJRurG+oycq6Sb9CiRDCBQG=hSMUkjiA@mail.gmail.com>

On Tue, 2012-07-17 at 13:46 +0300, Orgad and Raizel Shaneh wrote:
> Make a commit on top of master.
> 
> git rebase -i origin/master
> 
> Remove the commit.
> 
> Git prints "Nothing to do" and does not rebase.
> 
> Running 'git rebase -i' when there are no local commits has 'noop' in
> the first line, and with it the rebase is successful. Why is this
> 'noop' mandatory?

If you read the instructions, the last line says

    # However, if you remove everything, the rebase will be aborted

so if you want to do a no-op, then you need to tell it. This is the same
way you abort a commit, by providing it with an empty message.

But more important would be /why/ you feel that rebase -i is the tool
you should be using. If you'd like to move the branch pointer back,
that's what the reset command is for. rebase deals with moving commits
from one base to another and optionally reordering, squashing or
removing some of them.

   cmn

  reply	other threads:[~2012-07-17 11:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 10:46 git rebase -i does not rebase if all lines are removed Orgad and Raizel Shaneh
2012-07-17 10:55 ` Carlos Martín Nieto [this message]
2012-07-17 12:25   ` Johannes Sixt

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=1342522535.20671.7.camel@centaur.cmartin.tk \
    --to=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=orgads@gmail.com \
    /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).