How to get git diff with full context?

前端 未结 6 755
暗喜
暗喜 2021-01-30 07:48

How to create patch suitable for reviewing in crucible?

git diff branch master --no-prefix > patch

This generates only 3 lines of context. S

6条回答
  •  暖寄归人
    2021-01-30 08:16

    I know this is old, but I also dislike hard-coded solutions, so I tested this:

    git diff -U$(wc -l MYFILE)
    

    Using -U seems to be the only way to approach the issue, but using a line count promises that it will work for even a small change in a very large file.

提交回复
热议问题