# committing only selected diff's of a file

4 messages from 2007-12-03 to 2007-12-03. Participants: Erik Colson, Miklos Vajna, Jakub Narebski, Matthieu Moy.
Thread: https://gitlist.dev/t/11119

## Erik Colson, 2007-12-03 10:03

Subject: committing only selected diff's of a file
Message-ID: <4753D465.10802@ecocode.net>
URL: https://gitlist.dev/e/4753D465.10802%40ecocode.net

```
Hello,

Does Git allow to commit only selected patches from inside 1 file ?
I'm coming from a darcs world where this is supported...
Probably it is supported in Git too, but I can't figure out how :-/

Thanks for help
-- 
Erik

```

## Miklos Vajna, 2007-12-03 11:07

Subject: Re: committing only selected diff's of a file
Message-ID: <20071203110748.GZ31750@genesis.frugalware.org>
URL: https://gitlist.dev/e/20071203110748.GZ31750%40genesis.frugalware.org
In-Reply-To: <4753D465.10802@ecocode.net>

```
On Mon, Dec 03, 2007 at 11:03:17AM +0100, Erik Colson <eco@ecocode.net>
wrote:
> Does Git allow to commit only selected patches from inside 1 file ?
> I'm coming from a darcs world where this is supported...
> Probably it is supported in Git too, but I can't figure out how :-/

git add -i

(i also wrote a wrapper for people who come from darcs:
http://git.frugalware.org/repos/pacman-tools/darcs-git.py
but it contains many hacks so i don't want to advertise it too much as
others on this list will burn me :) )

- VMiklos

```

## Jakub Narebski, 2007-12-03 11:09

Subject: Re: committing only selected diff's of a file
Message-ID: <m3tzn0uj9s.fsf@roke.D-201>
URL: https://gitlist.dev/e/m3tzn0uj9s.fsf%40roke.D-201
In-Reply-To: <4753D465.10802@ecocode.net>

```
Erik Colson <eco@ecocode.net> writes:

> Does Git allow to commit only selected patches from inside 1 file ?
> I'm coming from a darcs world where this is supported...
> Probably it is supported in Git too, but I can't figure out how :-/

Use "git add --interactive" or "git gui" (the latter requires Tcl/Tk).

-- 
Jakub Narebski

```

## Matthieu Moy, 2007-12-03 16:00

Subject: Re: committing only selected diff's of a file
Message-ID: <vpqd4tnn4yt.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqd4tnn4yt.fsf%40bauges.imag.fr
In-Reply-To: <m3tzn0uj9s.fsf@roke.D-201>

```
Jakub Narebski <jnareb@gmail.com> writes:

> "git gui" (the latter requires Tcl/Tk).

... Right click on a patch hunk, "stage for commit".

-- 
Matthieu

```
