Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a functionality for git diff? #889

Open
aldanchenko opened this issue Jan 25, 2023 · 2 comments
Open

Is there a functionality for git diff? #889

aldanchenko opened this issue Jan 25, 2023 · 2 comments

Comments

@aldanchenko
Copy link

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!

@arnaudsm
Copy link

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

@aldanchenko
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants