For example, with git-diff I can do the following to show 10 surrounding lines of context when showing the diff.
git diff -U10
Can I do something similar with git-add --patch? Ideally I would like to to:
git add -p -U10
But I didn't find such option. Is there anything like this?
git diff has the -U<n> option which allows you to customize the number of lines to show around a change. For example, git diff -U5 ... will show 5 lines of context.
The git add command adds new or changed files in your working directory to the Git staging area. git add is an important command - without it, no git commit would ever do anything.
You can try:
git -c diff.context=10 add -p
If this works, you can make it permanent by using:
git config --global diff.context 10
This is the only thing I can find that might work.
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