4 ms·
`git add -p` is your friend to avoid adding unintended files/changes.
by Lindby 27d ago
`git add -p` is your friend to avoid adding unintended files/changes.
- eterm 27d agoWhat does that do, add already tracked files only?
- jdpage 27d agoIt interactively shows you each change that would be added and lets you decide whether it should be staged or not. Down to the hunk level, so you can partially stage a file if you so choose.
- eterm 27d agoOh, that's neat. The -p presumably stands for pInteractive with a silent p :)
- airstrike 27d agoLOL it might stand for "prompt before"
- oarmstrong 27d agoHa! It’s actually patch (as in select parts of the patch) though I remember it as partial.
- dxdm 27d agoThere's -i for interactive, lets you add, patch and reset (unstage).
- zelphirkalt 27d agoAh, that's what magit does by default.
- matijs 27d agoThat would be `git add -u/--update`