Skip to contentSkip to conversation

Staging Individual Lines

DISCUSSION ode 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

ode

author
#0 lore raw

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.

#1 lore raw
Quoted 10 lines · ode

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.

Quoted 7 lines

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.

Signature · 1 line
Felipe Contreras
#2 lore raw
In reply to ode

----- Original Message -----
From: ode
Date: 4/21/2013 4:22 PM

Quoted 2 lines

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