git-js
git-js copied to clipboard
Is there a functionality for git diff?
Hello,
I'm trying to receive git diff results. Right now I'm just using this raw version
const rawDiff = await git.diff([
this.branch,
filePath
]);
And after this I'm parsing raw string to object.
Maybe there is some another, more proper way to receive this data using classes/objects?
Thank you!
Yes, you can use git.diffSummary()
for that
Thank you for the reply @arnaudsm.
Unfortunately, this is not quite what I need. I need to know which lines was changed. For example, line 5 was add and line 10 was deleted. Something like this.