1

I'm using Git v2.10.2 (finally an update) on macOS Sierra. I noticed in the git log command, whenever I use the -L argument to look at specific lines of code of a file, git log prints out the diff output even when --no-patch is specified clearly. Without the -L, it works as it should behaves.

Is there something I'm missing with the -L parameter? Thanks!

Sample command:

git log --oneline --no-patch -L 1,3:package.json

1 Answer 1

3

--no-patch doesn't make sense with -L and therefore it is ignored. By providing the -L option, you select a range of lines in the specified revision of a file and tell git to show the history of that fragment, which cannot be done without showing diffs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.