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

Does this support git merge-base? #1027

Closed
onlywei opened this issue Sep 30, 2024 · 2 comments
Closed

Does this support git merge-base? #1027

onlywei opened this issue Sep 30, 2024 · 2 comments
Labels
more-info-needed More information is required in order to investigate

Comments

@onlywei
Copy link
Contributor

onlywei commented Sep 30, 2024

I want to know the SHA of the merge-base between two refs. I know I can use .diff and .diffSummary's --merge-base flag, but I want to just do a simple git merge-base without the diff. Is that possible with simple-git?

https://git-scm.com/docs/git-merge-base

@steveukx
Copy link
Owner

The best option would be to use the git.raw API:

const commit = await simpleGit({ trimmed: true }).raw('merge-base', '--independent', 'other-branch-name');

@steveukx steveukx added the more-info-needed More information is required in order to investigate label Sep 30, 2024
Copy link
Contributor

This issue has been automatically closed due to a lack of response. If your problem persists please open a new issue including any additional detail requested from this issue. For more detail on the issues/pull requests see ISSUES_AND_PULL_REQUESTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed More information is required in order to investigate
Projects
None yet
Development

No branches or pull requests

2 participants