Skip to content

Is there a functionality for git diff? #889

Open

Description

@aldanchenko

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!

Activity

  1. arnaudsm commented on Jan 28, 2023

    @arnaudsm

    Yes, you can use git.diffSummary() for that

  2. aldanchenko commented on Jan 28, 2023

    @aldanchenko
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions