-
Notifications
You must be signed in to change notification settings - Fork 23
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
guide: branching strategies #196
Comments
More resources
Click to reveal the source code of the diagram above...const graphContainer = document.getElementById("graph-container");
const gitgraph = GitgraphJS.createGitgraph(graphContainer, {orientation: 'vertical-reverse', author: 'User <name@domain>'});
const main = gitgraph.branch("main");
main.commit("Initial commit");
const experiment = gitgraph.branch("experiment");
experiment.commit("Launch two experiments");
const first = experiment.branch("first");
first.commit({subject: "Add artifacts from the first experiment", author: 'Bot <runner@machine>'})
const second = experiment.branch("second");
second.commit({subject: "Add artifacts from the second experiment", author: 'Bot <runner@machine>'})
experiment.merge(first, "Merge artifacts from the first experiment");
main.merge(experiment, "Merge improvements from the experiment branch"); |
I have a backlog item in my tasks "review this material for CML diagrams" pointing to this issue. Not sure why. Do you need this diagram recreated for docs or use case? |
I think this is more a @iterative/docs issue than a devrel one |
|
useful mentioned by @mjasion: https://mermaid-js.github.io/mermaid/#/gitgraph ```mermaid
gitGraph
commit
commit
branch develop
commit
commit
commit
checkout main
commit
commit
merge develop
commit
commit
``` gitGraph
commit
commit
branch develop
commit
commit
commit
checkout main
commit
commit
merge develop
commit
commit
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@jendefig actually raises a gewd point - someone new to Git graphs won't find the |
Thanks for this @casperdcl! This is how I was understanding how everything lined up. So is the blue line extending back to the develop branch because the merge occurred from the main branch. But if the merge occurred off the develop branch it would be yellow/chartreuse? Testing... gitGraph
commit
commit
branch develop
commit
commit
commit
checkout main
commit
commit
checkout develop
merge main
commit
commit
|
Ok. I get it now. You are jumping when you checkout. The in-between lines are representing where the merge is coming from. Git is like being in a Christopher Nolan movie. 💡 |
indeed. Some non-obvious things:
|
Re: Color I think it might be nice to have a generally agreed upon color for the main branch, but that's out of our control.
So the merge commit parents are the main and dev branches and the commit will appear in both, is that right?
ARGH x 2
When you say "a label," just confirming you are using the term in a general sense, not at all referring to labels in GH, right? The label is the branch name, did I understand this correctly? Thanks for these explanations! 🙏 |
more accurate: merge commit parents are a particular pair of commits on the main and dev branches
no, the merge commit only appears in the target (main) branch, not the source (dev) branch
yes, in this case I mean "a label" in the general sense, as in "a human-readable name/alias for a In fact a Footnotes
|
Diagrams and guide for collaborative branching strategies (e.g. using
cml pr
for experiments in a large team, reporting, rebase vs squash-merging, hiding unneeded rows in Studio, etc.)Also saving results https://stackoverflow.com/a/74563657/3896283
Also should mention caveats (e.g. cascading/nested PRs obscures reports).
Related resources:
on: workflow_dispatch
,commit message [skip-ci]
,if: contains(github.event.head_commit.message, '[trigger]')
)Related issues (potentially duplicates and/or sub-issues):
cml pr
needs more docs and/or diagrams #390The text was updated successfully, but these errors were encountered: