Y
Hacker News
new
|
ask
|
show
|
jobs
by
Lindby
89 days ago
`git add -p` is your friend to avoid adding unintended files/changes.
1 comments
eterm
89 days ago
What does that do, add already tracked files only?
link
jdpage
89 days ago
It 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.
link
eterm
89 days ago
Oh, that's neat.
The -p presumably stands for pInteractive with a silent p :)
link
oarmstrong
89 days ago
Ha! It’s actually patch (as in select parts of the patch) though I remember it as partial.
link
dxdm
89 days ago
There's -i for interactive, lets you add, patch and reset (unstage).
link
airstrike
89 days ago
LOL it might stand for "prompt before"
link
zelphirkalt
89 days ago
Ah, that's what magit does by default.
link
matijs
89 days ago
That would be `git add -u/--update`
link