Home » Eclipse Projects » EGit / JGit » How to view the diff of a file between a local file change and a local HEAD in JGIT in a text form(How to view the diff of a file between a local file change and a local HEAD in JGIT in a text form let say I have a file readme.txt on branch Dev, and I am cloned that branch and make some changes in)
How to view the diff of a file between a local file change and a local HEAD in JGIT in a text form let say I have a file readme.txt on branch Dev, and I am cloned that branch and make some changes in Readme.txt file, now the content is changed in Readme.txt in local working tree and local Head, so I want to see the diff of Readme.txt in a textual format
The low level API is DiffFormatter [1], the higher level porcelain API is DiffCommand [2].
You can also look at the JGit command line implementation of the diff command [3].
If you are looking for examples start digging from the corresponding unit tests.