Re: How to remove a specific hunk
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 31, 2007, 11:06 UTC
- Message-ID
- <Pine.LNX.4.64.0710311104450.4362@racer.site>
- In-Reply-To
- <13D08D3F-3647-4E20-AF80-8EC6FD14E66A@lrde.epita.fr>
Hi,
On Wed, 31 Oct 2007, Benoit SIGOURE wrote:
Show 17 quoted lines
> On Oct 26, 2007, at 9:20 PM, Alex Riesen wrote: > > > Pascal Obry, Fri, Oct 26, 2007 17:10:38 +0200: > > > > > > I'm very new to Git... but start to love it :) > > > > > > Before committing sometimes I want to remove a specific hunk. Say in > > > file a.txt I have in the diff 3 hunks, I want to revert/delete/remove > > > the second one. Is there a way to do that ? > > > > Take a look at git-gui. Try right-clicking in the diff pane at the > > bottom. > > This only allows you to stage a given hunk, not to remove one. Right > now I'm in a situation where I need to remove a specific hunk to compile > and it's sad that git-gui doesn't provide an option so that you can > right-click -> revert hunk.
You have seen that there are two different file lists, "staged changes" and "unstaged changes", right? AFAIK if you click on the file in "staged changes", you can find the staged hunk and then remove it from the staged area.
"Revert hunk" would not make any sense, since the hunk disappears once you staged/unstaged it.
Ciao, Dscho