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

gitGraph: support for displaying orphaned branches and unrelated histories #5366

Closed
mateusza opened this issue Mar 7, 2024 · 1 comment
Closed
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@mateusza
Copy link

mateusza commented Mar 7, 2024

Proposal

In git it is possible to create a new orphaned branch, that has no parent.

git checkout --orphan=unrelated-branch

The commits made on this branch can be later merged with --allow-unrelated-histories

This is also useful when we have two independent repositories with different (ideally non-conflicting) files, that at some point we want to merge into a single one.

Example

I imagine this could be expressed in Mermaid something like:

commit
commit
commit
branch another_main orphaned: true
commit
commit
commit
checkout main
merge another_main

and should render something like this:
image

Screenshots

No response

@mateusza mateusza added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Mar 7, 2024
@mateusza
Copy link
Author

mateusza commented Mar 7, 2024

Actually I realized this is already possible by declaring a branch before declaring a first commit on master branch.

@mateusza mateusza closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant