# Staging Individual Lines

3 messages from 2013-04-21 to 2013-04-22. Participants: ode, Felipe Contreras, Joshua Jensen.
Thread: https://gitlist.dev/t/33564

## ode, 2013-04-21 22:22

Subject: Staging Individual Lines
Message-ID: <517466B9.8010607@blueyonder.co.uk>
URL: https://gitlist.dev/e/517466B9.8010607%40blueyonder.co.uk

```
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?

Thanks for your help.

```

## Felipe Contreras, 2013-04-21 23:52

Subject: Re: Staging Individual Lines
Message-ID: <CAMP44s0Mj+inGX24=-RuV+oT5MZB==HZZvu6_5uZrP68qdPoZw@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s0Mj%2BinGX24%3D-RuV%2BoT5MZB%3D%3DHZZvu6_5uZrP68qdPoZw%40mail.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:
> 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

```

## Joshua Jensen, 2013-04-22 14:35

Subject: Re: Staging Individual Lines
Message-ID: <51754A96.8050508@workspacewhiz.com>
URL: https://gitlist.dev/e/51754A96.8050508%40workspacewhiz.com
In-Reply-To: <517466B9.8010607@blueyonder.co.uk>

```
----- Original Message -----
From: ode
Date: 4/21/2013 4:22 PM
> I went looking on Google and found git-cola gui client which works for
> staging individual lines to the commit.
The 'git gui' that ships with Git also stages individual lines and 
groups of lines, FWIW.

-Josh

```
