Re: staging specific lines out of a hunk for a commit
- From
Bert Wesarg <bert.wesarg@googlemail.com>
- Date
- Sep 21, 2010, 10:52 UTC
- Message-ID
- <AANLkTim=FQyBHcaHEX92YLgODrvpesuA7e4xwXuWcFg4@mail.gmail.com>
- In-Reply-To
- <AANLkTin4U78N_8LV8fCWuinNH9AFeOsRBjnvHM0qt2ZH@mail.gmail.com>
Hi,
On Tue, Sep 21, 2010 at 12:40, Graeme Geldenhuys <graemeg.lists@gmail.com> wrote:
Show 14 quoted lines
> Hi, > > I know 'git gui' has this cool feature where you can stage one line at > a time. This is really handy, but also very annoying, if you have a > large piece of code you want to commit. > > eg: I have a single hunk, which can't be split into smaller hunks > because it is all new code. But that hunk fixes a few bugs, or > introduces a few new features. > > Is there a way to use 'git add -i' or 'git add -p' or 'git gui' and > tell it to add for example lines 5-20 of the hunk to the index? > Currently with 'git gui', I have to right click and select 'Stage line > for commit' 15+ times! :-(
Just select the lines you would like to add, and than you can stage them at once.
> > I'm using git-gui 0.12.0.64 and git version 1.7.0.4.
But I don't know since when this feature is available.
Bert
> > -- > Regards, > - Graeme -