Re: How to remove a specific hunk
- From
- Olivier Ramonat <olivier@ramonat.fr>
- Date
- Oct 26, 2007, 21:59 UTC
- Message-ID
- <87prz1a65q.fsf@tah.ramonat.fr>
- In-Reply-To
- <47220A05.4040705@wanadoo.fr>
Pascal,
Pascal Obry <pascal.obry@wanadoo.fr> writes:
Show 13 quoted lines
> Andreas, > >> Once you've added the other two hunks, they'll no longer show up in >> git-diff, so you can do something like this: >> >> $ git-add -i; # add the other two hunks to commit >> $ git-diff > middle-hunk.patch >> $ git-apply -R middle-hunk.patch >> test, test, test >> $ git-apply middle-hunk.patch > > Thanks, this will clearly work. I was expecting something more > integrated like a "git reset --interactive" or something like that :)
A solution could be :
git add -i --> Add the two "good" hunks
git checkout-index file_with_bad_hunk --> Remove the "bad" hunk by getting the staged version
And then git reset HEAD file_with_bad_hunk if you want to unstage it.
Olivier