From: Jonathan del Strother Date: Tue, 21 Sep 2010 11:09:09 GMT Subject: Re: staging specific lines out of a hunk for a commit Message-ID: In-Reply-To: On 21 September 2010 11:40, Graeme Geldenhuys wrote: > 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! :-( > If you happen to be on a Mac, gitx allows you to select the lines you're interested in with the mouse and stage them.