Re: PATCH: improve git switch documentation
- From
Sergey Organov <sorganov@gmail.com>
- Date
- Jul 11, 2021, 09:52 UTC
- Message-ID
- <87im1hfa8r.fsf@osv.gnss.ru>
- In-Reply-To
- <60e9fa5132e14_7ef20849@natae.notmuch>
Felipe Contreras <felipe.contreras@gmail.com> writes:
> Sergey Organov wrote:
[...]
Show 6 quoted lines
>> Creating (a branch) is fundamentally different operation than switching >> to (a branch), and that's why the former doesn't fit into "git switch". > > Not in my mind. Instead of switching to an existing branch, I'm switching > to a new branch, which is easily understood by > `git switch --new branch`.
To me:
"create a new branch" is basic operation.
"switch to another branch" is basic operation.
"create a new branch and then switch to it" is compound operation.
The latter could be implemented as either new-then-switch or switch-to-new indeed, but the "new" part is the first action to be made, so
git new branch <branch-name>
that switches to the <branch-name> by default still sounds more logical to me than current:
git switch -c <branch-name>
Thanks,
-- Sergey Organov