git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Staging Individual Lines

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 21, 2013, 23:52 UTC
Message-ID
<CAMP44s0Mj+inGX24=-RuV+oT5MZB==HZZvu6_5uZrP68qdPoZw@mail.gmail.com>
In-Reply-To
<517466B9.8010607@blueyonder.co.uk>
On Sun, Apr 21, 2013 at 5:22 PM, ode <ode5002@blueyonder.co.uk> wrote:
Show 17 quoted lines
> Hi,
>
> I had a big commit I wanted to break up and was wondering if there is
> any way to stage individual lines from the command line.
>
> I am using git add -i but it couldn't split the hunks any smaller.
>
> I went looking on Google and found git-cola gui client which works for
> staging individual lines to the commit.
>
> But it's a bit clumsy to do this with the mouse and I was wondering if
> there is a way to do this without having manually editing the file and
> changing the diff numbers in git add -i when it can't break the hunks
> smaller.
>
> Why must we still manually edit the diff numbers when git-cola seems to
> be able to work out the changes automatically when adding single lines?
There is an 'edit' option. 'git add -p' might be faster.
Cheers.
-- 
Felipe Contreras
Previous: odeNext: Joshua Jensen
Message 2 of 3 in “Staging Individual Lines”
  1. odeApr 21, 2013
  2. Felipe ContrerasApr 21, 2013
  3. Joshua JensenApr 22, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.