git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Donlan <bdonlan@gmail.com>
To: Martin Paraskevov <martin.paraskevov@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git apply won't work
Date: Thu, 12 Mar 2009 20:09:44 -0400	[thread overview]
Message-ID: <3e8340490903121709w6c6c444o10e7c8b655246373@mail.gmail.com> (raw)
In-Reply-To: <a6d7dc140903121614s229ce97an2cb5737ef46c0421@mail.gmail.com>

On Thu, Mar 12, 2009 at 7:14 PM, Martin Paraskevov
<martin.paraskevov@gmail.com> wrote:
> Hi all,
>
> I did the following:
>
> edited
> did commit 1
> edited
> did commit 2
> edited
> did commit 3
>
> Now I want to patch the changes between 2 and 3 onto 1, i.e. have commit 3 but
> with the changes from commit 2 removed. I created a branch where I reset
> it to commit 1 and then tried to apply the diff between 3 and 2.
>
> The patch however won't patch certain files. It contains the excerpt below,
> for example, so it should be patching directory.c but it isn't. The command
> I'm running is just:
>
> % git apply filesys.patch
>
> What am I doing wrong?


It's hard to say what's going wrong when we can't see the exact
errors, git tree and patch in question, but if you just want to remove
a patch, there are easier ways to do it.

If you want to keep the old patch in the history, but reverse it, do:
  git revert commitid
This will record a new commit that reverses the changes in the
indicated one. This is the recommended way to do things if others have
based work off your branch.

If you want to completely forget about the patch in question, you can
do this using git rebase --interactive:
  git rebase --interactive commitid~
  (an editor will open; remove the patch in question from the list,
save and exit your editor)
  (fix any conflicts that come up as prompted)
This will delete it from history, but will result in commit IDs for
commits after that point changing. If anyone has based work off your
branch, then you might have a hard time merging later.

      reply	other threads:[~2009-03-13  0:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12 23:14 git apply won't work Martin Paraskevov
2009-03-13  0:09 ` Bryan Donlan [this message]

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=3e8340490903121709w6c6c444o10e7c8b655246373@mail.gmail.com \
    --to=bdonlan@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=martin.paraskevov@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).