Re:Show HN: Git Confirm. Git hook to catch accidentally comm...
by pimterry on Wednesday August 03, 2016 @01:17PM
(#12219645)
I built this mostly because I really like git add -p, but afaict it doesn't work at all for adding totally new files, and it's easy to miss things in the middle of big chunks of changes. But yeah, that's exactly the inspiration.
[ Parent
| on HN ]
Re:Show HN: Git Confirm. Git hook to catch accidentally comm...
by abusque on Wednesday August 03, 2016 @01:47PM
(#12219945)
> but afaict it doesn't work at all for adding totally new files
You can use git add --intent-to-add on your new file (or -N for short), and then use git add -p as usual. You can then use the edit mode to remove hunks you don't want to commit just yet.
Not quite as convenient as on an already tracked file, but it's reasonably usable.