-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
git-merge-base: add page #9382
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
git-merge-base: add page #9382
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||
| # git merge-base | ||||||
|
|
||||||
| > Find a common ancestor of two commits. | ||||||
| > More information: <https://git-scm.com/docs/git-merge-base>. | ||||||
|
|
||||||
| - Print the best common ancestor of two commits: | ||||||
|
|
||||||
| `git merge-base {{commit_1}} {{commit_2}}` | ||||||
|
|
||||||
| - Output all best common ancestors of two commits: | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the way git weighs merge bases, there actually can be two "best" ones, which means two of the same quality. But I agree that the wording is confusing, so maybe "all suitable" should be used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||||||
|
|
||||||
| `git merge-base --all {{commit_1}} {{commit_2}}` | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not commit_hash instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the git subcommand pages are not consistent in this matter, but the majority uses just commit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It means that consistency should be fixed. For instance we can write script to do that like in #9578 PR. |
||||||
|
|
||||||
| - Check if a commit is an ancestor of a specific commit: | ||||||
|
|
||||||
| `git merge-base --is-ancestor {{ancestor_commit}} {{commit}}` | ||||||
Uh oh!
There was an error while loading. Please reload this page.