6 ms·
You've always been able to do that via the command line (`git add -p <file>`) but it's definitely great to see it in a more user friendly form.
by zpao 15y ago
You've always been able to do that via the command line (`git add -p <file>`) but it's definitely great to see it in a more user friendly form.
- daemianmack 15y agoSort of. -p considers consecutive lines a single hunk. Often, that's not what I want. Luckily, there is magit: http://philjackson.github.com/magit/ http://philjackson.github.com/magit/
- troels 15y agoYou can split the hunks into smaller ones.
- rbonvall 15y agoAnd you can also edit the patch manually.
- rmgraham 15y agoI 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!
- bostonvaulter2 15y agoPlus 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
- daemianmack 15y agoYou 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.
- solutionyogi 15y agoYes, I am aware of git add -p but if you deal file with 500 lines of code, it's easier to have a UI to select lines you want to commit.
- Argorak 15y agoBy the way, is it possible to have git add -p show uncommitted files, like darcs does?
- bostonvaulter2 15y agoNot directly, but you can use git add -p for that. Although I don't think you get to review it first.