Repository navigation
Conversation
|
There is an issue in commit 37349e2:
|
jvns
force-pushed
the
tutorial-branches
branch
2 times, most recently
from
November 9, 2026 21:30
3f3877c to
b3288c1
Compare
Because Git's branches are so flexible and the meaning of a branch is only what people assign to it, it's important to talk about some of the social context about branches. Do this in two ways: 1. Introduce some imaginary characters who are learning branches for the first time and examples of workflows they might use. Test readers said this was helpful because it helped them see different ways they might use branches. 2. Explain the importance of a "main" or "master" branch in many projects, and give a few examples of how projects might use it. On `git log`: - Use the output of `git log --graph` to visualize branches instead of a more abstract ASCII diagram, since it serves a double purpose of teaching people how to read `git log`'s output. But also mention that folks may prefer to use a GUI to visualize branches. - Include two sections to explain the output of `git log`, since several test readers found it very hard to understand. In that explanation, only explain `HEAD` fairly briefly and instead keep the focus on the idea of a "current branch", since that's the term Git's UI normally uses. On the conceptual introduction at the beginning: - One of the biggest issues with explaining branches is that there are 3 ways in Git to think of branches and it's not straightforward to explain how to reconcile them: 1. just the commits that "branch off" 2. the latest commit on the branch 3. the full history since the beginning of time Handle this by starting with the "tree" metaphor where branches "branch off" a central trunk (way 1), since this makes sense with how people actually want to use branches. Point out some issues with the tree metaphor and talk about how it relates to the way Git represents branches (way 2). - Avoid using computer science jargon, because it's a major barrier to folks without a CS background. It's not useful or realistic to teach most beginners the term "directed acyclic graph" just so they can learn branches. Mention the term "directed acyclic graph" briefly in a note for folks who are already familiar with that term and link folks to the data model if they'd like more information. - Include some basic facts about commits. Folks seemed to find this helpful, one person said they didn't realize it would be so hard to change their email address later. To keep it readable: - Don't assume that the reader has read `gittutorial`, and instead refer back to it explicitly if it's relevant. - Always include the output for every command. Test readers said this was helpful. Other choices about material that is/isn't included: - `git-prompt.sh` (yes): Mention how important it is to be aware what branch you're on, and suggest using `git-prompt.sh`. Link to git-prompt.sh on GitHub since several test readers couldn't find it on their machine. The test readers liked this. - fast-forward merges (yes): Explain the difference between a fast-forward merge and a merge commit by giving examples of what each one looks like. - upstreams/rebase (no): Don't explain what an upstream is or introduce rebase, since we're already introducing a lot of concepts. Instead include a "Where to learn more" section with some pointers to where to continue learning. - GUIs (yes): Some readers wanted a suggestion for what GUI to use. It's very hard to suggest an appropriate GUI because there are so many and so many of them are not open source, but give a couple of suggestions of open source tools that seem to be popular with the community. Also mention that many non-open-source IDEs have built-in Git integrations for folks who are already using those tools who might not be aware, since they're a popular way to use Git. Co-Authored-By: Marie Claire LeBlanc Flanagan <hello@marieflanagan.com> Signed-off-by: Marie Claire LeBlanc Flanagan <hello@marieflanagan.com> Signed-off-by: Julia Evans <julia@jvns.ca>
jvns
force-pushed
the
tutorial-branches
branch
from
November 9, 2026 21:30
b3288c1 to
5eaecda
Compare
Author
|
/submit |
|
Submitted as pull.2307.git.1794259990263.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some self-review comments:
gittutorial.adoclands I think it would be good to add a little table of contents to the top of it to match this one's TOC.Thanks to Mario (bavarianbidi), Johnny, Ken Wells, Yatin Lala, Valentin Bachem, Ozgur Dincer, Ken Wells, matsch, and all the other test readers for giving feedback on this. We got 70 comments from 16 people.
cc: Patrick Steinhardt ps@pks.im
cc: "D. Ben Knoble" ben.knoble@gmail.com