Skip to content

Comment on GitHub for Mac 1.1parent

Comments

Sort of. -p considers consecutive lines a single hunk. Often, that's not what I want. Luckily, there is magit: http://philjackson.github.com/magit/

You can split the hunks into smaller ones.

You can split hunks until they're consecutive lines. You can't split more granularly than that with -p. You'd need to edit the patch, either directly or with git gui or similar.

And you can also edit the patch manually.

I resisted the edit option of git-add -p for a long time because I was afraid of messing something up with a low level tool... big mistake! So easy to use!

Plus if you make a patch that doesn't apply it will just error out and you can try again. And if you add anything extra by mistake you can easily back it out with something like git reset HEAD <file> or git reset -p

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.