How can I interactively disable a specific piece in git?

In git, if I have a couple of hunks from the same file put in my index, how can I interactively disable one of them?

Is there any alternative to not installing the whole file, and then re-setting the hunks that I want to save, or manually undoing changes to the working copy, and then interactively adding those undo changes?

+74
git staging
Mar 04 '11 at 0:20
source share
2 answers

Try git reset --patch filename ; this should do the opposite of git add --patch , as per the documentation. The short form -p also works for both commands.

+94
Mar 04 2018-11-11T00: 00Z
source share

GitX has a nice user interface for unordered file fragments: enter image description here

The official client has not been supported for a while, but the fork on GitHub with many features is popular in some circles. ( blog post about this )

+1
Mar 04 2018-11-11T00:
source share



All Articles