5 ms·
"Split off a logical chunk from your mess, stage it" should really be another box with "git add -p". Being able to pick and choose (and even edit) individual c
by christop 12y ago
"Split off a logical chunk from your mess, stage it" should really be another box with "git add -p".
Being able to pick and choose (and even edit) individual chunks to be staged is enormously useful. Quite possibly my favourite feature of git.
- bobthecow 12y agoThat's in the tl;dr
- adregan 12y agogit add -p has absolutely changed my work flow and commit histories for the better.
- adestefan 12y agoI find that git add -p is a crutch and everytime I need to use it I scold myself for not committing more often.
- serge2k 12y agoThat does sound useful, I have a bad habit of letting things get messy. Lots and lots of rebase -i.
- digikata 12y agoI agree with the git add -p , but I feel that at point, it often should be followed by a stash then a rebuild and/or some testing. Next, commit and unstash to continue.
- bobthecow 12y agoYep yep. `git add -p`, `git stash -p`, etc. That's exactly why that bit of the chart isn't very specific. There's a whole workflow right there, in that one little cycle. One of these days I'll get around to writing that one up :)
- bulte-rs 12y agogit isolate! I've been trying to make something like this :( Unfortunately my git-fu is failing me.
- __david__ 12y agoMine too. If you ever want that functionality on a non-git VCS, I co-wrote a tool that does just that (it predates git, actually) called commit-patch[1]. It integrates into Emacs nicely and also has 'commit-partial' for a nice command-line interface. [1] http://porkrind.org/commit-patch/ http://porkrind.org/commit-patch/
- philsnow 12y agoOnce upon a time I used darcs, where the interactive staging / interactive committing feels even nicer. Git's "git add -i" stuff has always seemed crufty to me. For instance, in git add -i, the command to stage changes is called "update". The command to unstage is called "revert". Further, does _anybody_ use interactive adding when not intending to stage individual hunks from some file ? Yet there are all these other commands in there to stage/unstage whole files, which are more easily and uniformly done from the command line tools (well, when you accept that staging is called "add"ding on the command line and unstaging is called "reset"ting).
- eru 12y ago> Quite possibly my favourite feature of git. Mine, too. Fortunately, mercurial has that feature, too. (Though you might need a plugin.)