From: Alban Gruin Date: Wed, 25 Apr 2018 15:05:34 GMT Subject: Re: java diffs show no method context Message-ID: In-Reply-To: <5AE07A3A020000A10002B5C5@gwsmtp1.uni-regensburg.de> Le 25/04/2018 à 14:53, Ulrich Windl a écrit : > Hi! > > This is for git 2.13.6, and it may be an FAQ or frequent feature request. Anyway: > I'm new to Java, and writing my first project using Git, I found that "git diff" only reports the class in the diff context, but not the method (as seen for C, for example). > I'd wish to have the method where the diff is located. Hi, to achieve this behaviour, you have to create a file named ".gitattributes" at the root of your project, containing this line: *.java diff=java .gitattributes allows you to configure other things, as described in the documentation[1]. I hope it helps. [1] https://www.git-scm.com/docs/gitattributes Cheers, Alban