On Mon, Nov 30, 2026 at 11:10 AM Julia Evans <jul…@jvns.ca> wrote:
>
> >> +Step 8: Create another branch > >> +----------------------------- > >> + > >> +Now create a second branch called `add-animals`. We're creating two > >> +branches to show what the process of working on multiple changes at the > >> +same time looks like. > >> + > >> +You'll usually want to start all new branches from the `main` branch > >> +to keep your branches independent from each other. Right now > >> +we're on the `add-fruits` branch, so we need to switch back to the > >> +`main` branch: > >> + > >> +----- > >> +$ git switch main > >> +----- > >> + > >> +Then create a branch called `add-animals`. > >> + > >> +----- > >> +$ git switch -c add-animals > >> +-----
> > I assume we are choosing not to teach "git switch -c add-animals main" for some > > reason here? > > > > One reason I can imagine is that, depending on config like branch.autoSetupMerge > > and the shape of the 2nd argument (main with config=inherit, origin/main with > > default config, etc.), we end up configuring an upstream, and you said this > > tutorial intentionally omits that. So while someone following the tutorial who > > has not configured branch.autoSetupMerge away from the default would not have > > any surprising upstream behavior from "git switch -c add-animals main" we cannot > > control what will or won't happen, which might be confusing. > > > > Is that what you were thinking, or something else?
> > I'd never heard of the syntax 'git switch -c add-animals main' until > right now! :)
Aha, I suspected that was an option, too :)
> My first reaction upon seeing that is that I'd be quite reluctant to use > it or recommend it because I very often hear from users that when a > command has 2 arguments that need to be specified in an order it's hard > for them to remember the order. For example with 'git checkout main -- > file.txt' or 'ln -s file1.txt file2.txt'. Personally I don't think I > could remember the order of the arguments without looking it up (in 'git > switch branch1 branch2', what does each one mean?).
That's fair! The *only* form with 2 arguments is "switch -c|--create|-C|--force-create", though, and the created branch always comes after the "create" option. I'm ok with not using this form here, even if I find it convenient. Might be something we want to justify in the log message, which I realize is already long ':D Then if a future editor wants to use shorthands, at least there's something for them to find to consider why it is this way now.
> > (One reason I point it out is that I'm a personal fan of the ways Git helps me > > type *less*, and I think the "multiple commands to achieve one logical thing" > > contributes to the scary/complex reputation---OTOH, avoiding upstream stuff here > > seems like the right way to go.)
> > I'm not sure if "multiple commands to achieve one logical thing" > contributes to Git's scary/complex reputation. That could be true! It's > not something I've ever considered as a factor.
Yeah, I dunno---it's speculation on my part. Maybe more precisely I think it contributes to folks thinking of Git as "hard" (which it certainly can be): they have to remember multiple commands to achieve a single task, which we know from cognitive research adds additional cognitive load. That load can either push other things out of our brains or cause us to forget a step when we try to hold on to the stuff we don't want to lose! I suppose I'm a bit of an oddball though, in that I almost never do anything other than git switch -c <new-branch> origin to create a new branch, though. Anyway, if you decide not to change that, I'm personally happy with this version (and you/Junio can add my Reviewed-by, if you like).
-- D. Ben Knoble