RSE-Sheffield / git-github-zero-to-hero

Training materials for zero to hero training in version control through git, github and gitkraken
https://srse-git-github-zero2hero.netlify.app/
17 stars 10 forks source link

Adding git graphs to the materials? #50

Open davidwilby opened 2 years ago

davidwilby commented 2 years ago

Feel free to disagree! (also could move this to GH discussions if we think it would be beneficial)

I think that a couple of additional visuals would help me personally when delivering this training to illustrate some of the concepts around commits and branches.

In the advanced collaboration section, I wonder if we could do with a diagram that shows branching a bit more visually.

The current diagram we have here:

does a good job illustrating the flow IMO, but doesn't visually show the branching concept.

We could add something like the following to show branching a bit more clearly.

gitGraph
    commit
    commit
    commit
    commit
    commit
    branch feature
    checkout feature
    commit
    commit
    checkout main

(aside: check out this sweet mermaid gitgraph feature)

Which could then be extended to show the pull request and merge steps, e.g.

gitGraph
    commit
    commit
    commit
    commit
    commit
    branch feature
    checkout feature
    commit
    commit
    checkout main
    merge feature

I'd be interested to know others' thoughts on this.

EdwinB12 commented 2 years ago

Having just done the course as a participator, I came to post this exact issue. I think the above gitgraphs (very nice!) are a welcome addition to explain the power of branching.

ns-rse commented 1 year ago

Further using git-sim might be useful to help visualise some aspects.

Most recent run of the course people were asking a lot of questions about the difference between forking and cloning. The slides do already cover this I think but animations are pretty!

ns-rse commented 8 months ago

This can be done by leveraging mermaid.live which once you've constructed your graph provides a link to embed it in Markdown under the Action button on the bottom left, it provides...

[![](https://mermaid.ink/img/pako:eNqlVl1v2jAU_SuWJcQLQ4kTKMkb68fWqV23frxMvJjkBqwmNnKcjhbx33eTkAloUgglD9jxOdfHvuc6XtFAhUB92umshBTGJ6uumUMCXZ90pzyFbo90Z8J803wx7-ajWhlu4FwliTA3fAoxvjU6g_VEkuqH7XWnU76oyP-Hg4JKROiTCb3hqSERcJNpmNB6zIvVt_vW1uhUcxnMNyMkEktI33Mn9HEu0gqLrUjpEkuMIjmzLuKtSFMhZ-THw91PRMdQ8vbgO_LGYUiSbdomfN_ahN0mziF4Vplp0p6AnsFpMoop7bq5Ei5kPeeq3Hi7Cs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