Skip to contentSkip to conversation

committing only selected diff's of a file

DISCUSSION Erik Colson 4 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

Signature · 1 line
Erik
#1 lore raw
Quoted 3 lines · Erik Colson

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

#2 lore raw
In reply to Erik Colson
Quoted 3 lines · Erik Colson

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).

Signature · 1 line
Jakub Narebski
#3 lore raw
Quoted 1 line · Jakub Narebski

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

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

Signature · 1 line
Matthieu