I'm using Git add's interactive mode (git add -i
) for the first time and have a question about the diff
command it offers. By default, it shows a diff for changes I've already staged (equivalent to using git diff --staged
). Is there a way to make it show a diff of unstaged changes? This would be really helpful for when I need to selectively add some files for staging and want to see the changes I made before adding them. I would like to do this without leaving interactive mode or having another terminal open to do a regular git diff
.
With git add -p
or the patch
option of git add -i
you see the individual changed hunks before you decide whether to stage them or not. You can also change between the unstaged hunks of a file before deciding whether to stage hunks or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With