git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 19/19] doc: promote "git switch"

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 8, 2019, 09:04 UTC
Message-ID
<20190208090401.14793-20-pclouds@gmail.com>
In-Reply-To
<20190208090401.14793-1-pclouds@gmail.com>

The new command "git switch" is added to avoid the confusion of one-command-do-all "git checkout" for new users. They are also helpful to avoid ambiguation context.

For these reasons, promote it everywhere possible. This includes documentation, suggestions/advice from other commands...

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Documentation/git-branch.txt           | 12 +++---
 Documentation/git-check-ref-format.txt |  3 +-
 Documentation/git-format-patch.txt     |  2 +-
 Documentation/git-merge-base.txt       |  2 +-
 Documentation/git-rebase.txt           |  2 +-
 Documentation/git-remote.txt           |  2 +-
 Documentation/git-rerere.txt           | 10 ++---
 Documentation/git-reset.txt            | 20 ++++-----
 Documentation/git-stash.txt            |  9 +++--
 Documentation/gitcore-tutorial.txt     | 18 ++++-----
 Documentation/giteveryday.txt          | 24 +++++------
 Documentation/gittutorial.txt          |  4 +-
 Documentation/revisions.txt            |  2 +-
 Documentation/user-manual.txt          | 56 +++++++++++++-------------
 advice.c                               | 11 +++--
 sha1-name.c                            |  2 +-
 t/t2020-checkout-detach.sh             | 16 ++++----
 17 files changed, 100 insertions(+), 95 deletions(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index bf5316ffa9..3cf6153415 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -48,7 +48,7 @@ The command's second form creates a new branch head named <branchname>
 which points to the current `HEAD`, or <start-point> if given.
 
 Note that this will create the new branch, but it will not switch the
-working tree to it; use "git checkout <newbranch>" to switch to the
+working tree to it; use "git switch <newbranch>" to switch to the
 new branch.
 
 When a local branch is started off a remote-tracking branch, Git sets up the
@@ -194,7 +194,7 @@ This option is only applicable in non-verbose mode.
 +
 This behavior is the default when the start point is a remote-tracking branch.
 Set the branch.autoSetupMerge configuration variable to `false` if you
-want `git checkout` and `git branch` to always behave as if `--no-track`
+want `git switch`, `git checkout` and `git branch` to always behave as if `--no-track`
 were given. Set it to `always` if you want this behavior when the
 start-point is either a local or remote-tracking branch.
 
@@ -293,7 +293,7 @@ Start development from a known tag::
 $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
 $ cd my2.6
 $ git branch my2.6.14 v2.6.14   <1>
-$ git checkout my2.6.14
+$ git switch my2.6.14
 ------------
 +
 <1> This step and the next one could be combined into a single step with
@@ -318,9 +318,9 @@ is currently checked out) does not have all commits from the test branch.
 NOTES
 -----
 
-If you are creating a branch that you want to checkout immediately, it is
-easier to use the git checkout command with its `-b` option to create
-a branch and check it out with a single command.
+If you are creating a branch that you want to switch to immediately,
+it is easier to use the "git switch" command with its `-c` option to
+do the same thing with a single command.
 
 The options `--contains`, `--no-contains`, `--merged` and `--no-merged`
 serve four related but different purposes:
diff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt
index d9de992585..ee6a4144fb 100644
--- a/Documentation/git-check-ref-format.txt
+++ b/Documentation/git-check-ref-format.txt
@@ -88,7 +88,8 @@ but it is explicitly forbidden at the beginning of a branch name).
 When run with `--branch` option in a repository, the input is first
 expanded for the ``previous checkout syntax''
 `@{-n}`.  For example, `@{-1}` is a way to refer the last thing that
-was checked out using "git checkout" operation. This option should be
+was checked out using "git switch" or "git checkout" operation.
+This option should be
 used by porcelains to accept this syntax anywhere a branch name is
 expected, so they can act as if you typed the branch name. As an
 exception note that, the ``previous checkout operation'' might result
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 27304428a1..3d42853529 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -421,7 +421,7 @@ One way to test if your MUA is set up correctly is:
 * Apply it:
 
     $ git fetch <project> master:test-apply
-    $ git checkout test-apply
+    $ git switch test-apply
     $ git reset --hard
     $ git am a.patch
 
diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt
index 9f07f4f6ed..261d5c1164 100644
--- a/Documentation/git-merge-base.txt
+++ b/Documentation/git-merge-base.txt
@@ -149,7 +149,7 @@ instead.
 Discussion on fork-point mode
 -----------------------------
 
-After working on the `topic` branch created with `git checkout -b
+After working on the `topic` branch created with `git switch -c
 topic origin/master`, the history of remote-tracking branch
 `origin/master` may have been rewound and rebuilt, leading to a
 history of this shape:
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 4dd5853d6e..420777c10b 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -17,7 +17,7 @@ SYNOPSIS
 DESCRIPTION
 -----------
 If <branch> is specified, 'git rebase' will perform an automatic
-`git checkout <branch>` before doing anything else.  Otherwise
+`git switch <branch>` before doing anything else.  Otherwise
 it remains on the current branch.
 
 If <upstream> is not specified, the upstream configured in
diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index 0cad37fb81..9659abbf8e 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -230,7 +230,7 @@ $ git branch -r
   staging/master
   staging/staging-linus
   staging/staging-next
-$ git checkout -b staging staging/master
+$ git switch -c staging staging/master
 ...
 ------------
 
diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt
index df310d2a58..fe4434ad9d 100644
--- a/Documentation/git-rerere.txt
+++ b/Documentation/git-rerere.txt
@@ -91,7 +91,7 @@ For such a test, you need to merge master and topic somehow.
 One way to do it is to pull master into the topic branch:
 
 ------------
-	$ git checkout topic
+	$ git switch topic
 	$ git merge master
 
               o---*---o---+ topic
@@ -113,10 +113,10 @@ the upstream might have been advanced since the test merge `+`,
 in which case the final commit graph would look like this:
 
 ------------
-	$ git checkout topic
+	$ git switch topic
 	$ git merge master
 	$ ... work on both topic and master branches
-	$ git checkout master
+	$ git switch master
 	$ git merge topic
 
               o---*---o---+---o---o topic
@@ -136,11 +136,11 @@ merges, you could blow away the test merge, and keep building on
 top of the tip before the test merge:
 
 ------------
-	$ git checkout topic
+	$ git switch topic
 	$ git merge master
 	$ git reset --hard HEAD^ ;# rewind the test merge
 	$ ... work on both topic and master branches
-	$ git checkout master
+	$ git switch master
 	$ git merge topic
 
               o---*---o-------o---o topic
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 9f69ae8b69..020ba838c9 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -149,9 +149,9 @@ See also the `--amend` option to linkgit:git-commit[1].
 Undo a commit, making it a topic branch::
 +
 ------------
-$ git branch topic/wip     <1>
-$ git reset --hard HEAD~3  <2>
-$ git checkout topic/wip   <3>
+$ git branch topic/wip          <1>
+$ git reset --hard HEAD~3       <2>
+$ git switch topic/wip          <3>
 ------------
 +
 <1> You have made some commits, but realize they were premature
@@ -232,13 +232,13 @@ working tree are not in any shape to be committed yet, but you
 need to get to the other branch for a quick bugfix.
 +
 ------------
-$ git checkout feature ;# you were working in "feature" branch and
-$ work work work       ;# got interrupted
+$ git switch feature  ;# you were working in "feature" branch and
+$ work work work      ;# got interrupted
 $ git commit -a -m "snapshot WIP"                 <1>
-$ git checkout master
+$ git switch master
 $ fix fix fix
 $ git commit ;# commit with real log
-$ git checkout feature
+$ git switch feature
 $ git reset --soft HEAD^ ;# go back to WIP state  <2>
 $ git reset                                       <3>
 ------------
@@ -279,18 +279,18 @@ reset it while keeping the changes in your working tree.
 +
 ------------
 $ git tag start
-$ git checkout -b branch1
+$ git switch -c branch1
 $ edit
 $ git commit ...                            <1>
 $ edit
-$ git checkout -b branch2                   <2>
+$ git switch -c branch2                     <2>
 $ git reset --keep start                    <3>
 ------------
 +
 <1> This commits your first edits in `branch1`.
 <2> In the ideal world, you could have realized that the earlier
     commit did not belong to the new topic when you created and switched
-    to `branch2` (i.e. `git checkout -b branch2 start`), but nobody is
+    to `branch2` (i.e. `git switch -c branch2 start`), but nobody is
     perfect.
 <3> But you can use `reset --keep` to remove the unwanted commit after
     you switched to `branch2`.
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 7ef8c47911..ebb6282db3 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -235,12 +235,12 @@ return to your original branch to make the emergency fix, like this:
 +
 ----------------------------------------------------------------
 # ... hack hack hack ...
-$ git checkout -b my_wip
+$ git switch -c my_wip
 $ git commit -a -m "WIP"
-$ git checkout master
+$ git switch master
 $ edit emergency fix
 $ git commit -a -m "Fix in a hurry"
-$ git checkout my_wip
+$ git switch my_wip
 $ git reset --soft HEAD^
 # ... continue hacking ...
 ----------------------------------------------------------------
@@ -293,7 +293,8 @@ SEE ALSO
 linkgit:git-checkout[1],
 linkgit:git-commit[1],
 linkgit:git-reflog[1],
-linkgit:git-reset[1]
+linkgit:git-reset[1],
+linkgit:git-switch[1]
 
 GIT
 ---
diff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt
index e29a9effcc..6bd0f192cc 100644
--- a/Documentation/gitcore-tutorial.txt
+++ b/Documentation/gitcore-tutorial.txt
@@ -741,7 +741,7 @@ used earlier, and create a branch in it. You do that by simply just
 saying that you want to check out a new branch:
 
 ------------
-$ git checkout -b mybranch
+$ git switch -c mybranch
 ------------
 
 will create a new branch based at the current `HEAD` position, and switch
@@ -755,7 +755,7 @@ just telling 'git checkout' what the base of the checkout would be.
 In other words, if you have an earlier tag or branch, you'd just do
 
 ------------
-$ git checkout -b mybranch earlier-commit
+$ git switch -c mybranch earlier-commit
 ------------
 
 and it would create the new branch `mybranch` at the earlier commit,
@@ -765,7 +765,7 @@ and check out the state at that time.
 You can always just jump back to your original `master` branch by doing
 
 ------------
-$ git checkout master
+$ git switch master
 ------------
 
 (or any other branch-name, for that matter) and if you forget which
@@ -794,7 +794,7 @@ $ git branch <branchname> [startingpoint]
 
 which will simply _create_ the branch, but will not do anything further.
 You can then later -- once you decide that you want to actually develop
-on that branch -- switch to that branch with a regular 'git checkout'
+on that branch -- switch to that branch with a regular 'git switch'
 with the branchname as the argument.
 
 
@@ -808,7 +808,7 @@ being the same as the original `master` branch, let's make sure we're in
 that branch, and do some work there.
 
 ------------------------------------------------
-$ git checkout mybranch
+$ git switch mybranch
 $ echo "Work, work, work" >>hello
 $ git commit -m "Some work." -i hello
 ------------------------------------------------
@@ -825,7 +825,7 @@ does some work in the original branch, and simulate that by going back
 to the master branch, and editing the same file differently there:
 
 ------------
-$ git checkout master
+$ git switch master
 ------------
 
 Here, take a moment to look at the contents of `hello`, and notice how they
@@ -958,7 +958,7 @@ to the `master` branch. Let's go back to `mybranch`, and run
 'git merge' to get the "upstream changes" back to your branch.
 
 ------------
-$ git checkout mybranch
+$ git switch mybranch
 $ git merge -m "Merge upstream changes." master
 ------------
 
@@ -1133,9 +1133,9 @@ Remember, before running 'git merge', our `master` head was at
 work." commit.
 
 ------------
-$ git checkout mybranch
+$ git switch mybranch
 $ git reset --hard master^2
-$ git checkout master
+$ git switch master
 $ git reset --hard master^
 ------------
 
diff --git a/Documentation/giteveryday.txt b/Documentation/giteveryday.txt
index 9f2528fc8c..38015026bb 100644
--- a/Documentation/giteveryday.txt
+++ b/Documentation/giteveryday.txt
@@ -41,7 +41,7 @@ following commands.
 
   * linkgit:git-log[1] to see what happened.
 
-  * linkgit:git-checkout[1] and linkgit:git-branch[1] to switch
+  * linkgit:git-switch[1] and linkgit:git-branch[1] to switch
     branches.
 
   * linkgit:git-add[1] to manage the index file.
@@ -80,7 +80,7 @@ $ git tag v2.43 <2>
 Create a topic branch and develop.::
 +
 ------------
-$ git checkout -b alsa-audio <1>
+$ git switch -c alsa-audio <1>
 $ edit/compile/test
 $ git checkout -- curses/ux_audio_oss.c <2>
 $ git add curses/ux_audio_alsa.c <3>
@@ -90,7 +90,7 @@ $ git commit -a -s <5>
 $ edit/compile/test
 $ git diff HEAD^ <6>
 $ git commit -a --amend <7>
-$ git checkout master <8>
+$ git switch master <8>
 $ git merge alsa-audio <9>
 $ git log --since='3 days ago' <10>
 $ git log v2.43.. curses/ <11>
@@ -148,11 +148,11 @@ Clone the upstream and work on it.  Feed changes to upstream.::
 ------------
 $ git clone git://git.kernel.org/pub/scm/.../torvalds/linux-2.6 my2.6
 $ cd my2.6
-$ git checkout -b mine master <1>
+$ git switch -c mine master <1>
 $ edit/compile/test; git commit -a -s <2>
 $ git format-patch master <3>
 $ git send-email --to="person <email@example.com>" 00*.patch <4>
-$ git checkout master <5>
+$ git switch master <5>
 $ git pull <6>
 $ git log -p ORIG_HEAD.. arch/i386 include/asm-i386 <7>
 $ git ls-remote --heads http://git.kernel.org/.../jgarzik/libata-dev.git <8>
@@ -194,7 +194,7 @@ satellite$ edit/compile/test/commit
 satellite$ git push origin <4>
 
 mothership$ cd frotz
-mothership$ git checkout master
+mothership$ git switch master
 mothership$ git merge satellite/master <5>
 ------------
 +
@@ -216,7 +216,7 @@ machine into the master branch.
 Branch off of a specific tag.::
 +
 ------------
-$ git checkout -b private2.6.14 v2.6.14 <1>
+$ git switch -c private2.6.14 v2.6.14 <1>
 $ edit/compile/test; git commit -a
 $ git checkout master
 $ git cherry-pick v2.6.14..private2.6.14 <2>
@@ -274,14 +274,14 @@ $ mailx <3>
 & s 2 3 4 5 ./+to-apply
 & s 7 8 ./+hold-linus
 & q
-$ git checkout -b topic/one master
+$ git switch -c topic/one master
 $ git am -3 -i -s ./+to-apply <4>
 $ compile/test
-$ git checkout -b hold/linus && git am -3 -i -s ./+hold-linus <5>
-$ git checkout topic/one && git rebase master <6>
-$ git checkout pu && git reset --hard next <7>
+$ git switch -c hold/linus && git am -3 -i -s ./+hold-linus <5>
+$ git switch topic/one && git rebase master <6>
+$ git switch pu && git reset --hard next <7>
 $ git merge topic/one topic/two && git merge hold/linus <8>
-$ git checkout maint
+$ git switch maint
 $ git cherry-pick master~4 <9>
 $ compile/test
 $ git tag -s -m "GIT 0.99.9x" v0.99.9x <10>
diff --git a/Documentation/gittutorial.txt b/Documentation/gittutorial.txt
index 242de31cb6..e6ad6b5f8d 100644
--- a/Documentation/gittutorial.txt
+++ b/Documentation/gittutorial.txt
@@ -207,7 +207,7 @@ automatically.  The asterisk marks the branch you are currently on;
 type
 
 ------------------------------------------------
-$ git checkout experimental
+$ git switch experimental
 ------------------------------------------------
 
 to switch to the experimental branch.  Now edit a file, commit the
@@ -216,7 +216,7 @@ change, and switch back to the master branch:
 ------------------------------------------------
 (edit file)
 $ git commit -a
-$ git checkout master
+$ git switch master
 ------------------------------------------------
 
 Check that the change you made is no longer visible, since it was
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index 72daa20e76..a1c7a65da6 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -115,7 +115,7 @@ Here's an example to make it more clear:
 ------------------------------
 $ git config push.default current
 $ git config remote.pushdefault myfork
-$ git checkout -b mybranch origin/master
+$ git switch -c mybranch origin/master
 
 $ git rev-parse --symbolic-full-name @{upstream}
 refs/remotes/origin/master
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index eff7890274..94799faa2b 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -122,10 +122,10 @@ Tags are expected to always point at the same version of a project,
 while heads are expected to advance as development progresses.
 
 Create a new branch head pointing to one of these versions and check it
-out using linkgit:git-checkout[1]:
+out using linkgit:git-switch[1]:
 
 ------------------------------------------------
-$ git checkout -b new v2.6.13
+$ git switch -c new v2.6.13
 ------------------------------------------------
 
 The working directory then reflects the contents that the project had
@@ -282,10 +282,10 @@ a summary of the commands:
 	this command will fail with a warning.
 `git branch -D <branch>`::
 	delete the branch `<branch>` irrespective of its merged status.
-`git checkout <branch>`::
+`git switch <branch>`::
 	make the current branch `<branch>`, updating the working
 	directory to reflect the version referenced by `<branch>`.
-`git checkout -b <new> <start-point>`::
+`git switch -c <new> <start-point>`::
 	create a new branch `<new>` referencing `<start-point>`, and
 	check it out.
 
@@ -302,22 +302,22 @@ ref: refs/heads/master
 Examining an old version without creating a new branch
 ------------------------------------------------------
 
-The `git checkout` command normally expects a branch head, but will also
-accept an arbitrary commit; for example, you can check out the commit
-referenced by a tag:
+The `git switch` command normally expects a branch head, but will also
+accept an arbitrary commit when invoked with --detach; for example,
+you can check out the commit referenced by a tag:
 
 ------------------------------------------------
-$ git checkout v2.6.17
+$ git switch --detach v2.6.17
 Note: checking out 'v2.6.17'.
 
 You are in 'detached HEAD' state. You can look around, make experimental
 changes and commit them, and you can discard any commits you make in this
-state without impacting any branches by performing another checkout.
+state without impacting any branches by performing another switch.
 
 If you want to create a new branch to retain commits you create, you may
-do so (now or later) by using -b with the checkout command again. Example:
+do so (now or later) by using -c with the switch command again. Example:
 
-  git checkout -b new_branch_name
+  git switch -c new_branch_name
 
 HEAD is now at 427abfa Linux v2.6.17
 ------------------------------------------------
@@ -373,7 +373,7 @@ You might want to build on one of these remote-tracking branches
 on a branch of your own, just as you would for a tag:
 
 ------------------------------------------------
-$ git checkout -b my-todo-copy origin/todo
+$ git switch -c my-todo-copy origin/todo
 ------------------------------------------------
 
 You can also check out `origin/todo` directly to examine it or
@@ -2211,8 +2211,8 @@ $ git branch --track release origin/master
 These can be easily kept up to date using linkgit:git-pull[1].
 
 -------------------------------------------------
-$ git checkout test && git pull
-$ git checkout release && git pull
+$ git switch test && git pull
+$ git switch release && git pull
 -------------------------------------------------
 
 Important note!  If you have any local changes in these branches, then
@@ -2264,7 +2264,7 @@ tested changes
 2) help future bug hunters that use `git bisect` to find problems
 
 -------------------------------------------------
-$ git checkout -b speed-up-spinlocks v2.6.35
+$ git switch -c speed-up-spinlocks v2.6.35
 -------------------------------------------------
 
 Now you apply the patch(es), run some tests, and commit the change(s).  If
@@ -2279,7 +2279,7 @@ When you are happy with the state of this change, you can merge it into the
 "test" branch in preparation to make it public:
 
 -------------------------------------------------
-$ git checkout test && git merge speed-up-spinlocks
+$ git switch test && git merge speed-up-spinlocks
 -------------------------------------------------
 
 It is unlikely that you would have any conflicts here ... but you might if you
@@ -2291,7 +2291,7 @@ see the value of keeping each patch (or patch series) in its own branch.  It
 means that the patches can be moved into the `release` tree in any order.
 
 -------------------------------------------------
-$ git checkout release && git merge speed-up-spinlocks
+$ git switch release && git merge speed-up-spinlocks
 -------------------------------------------------
 
 After a while, you will have a number of branches, and despite the
@@ -2512,7 +2512,7 @@ Suppose that you create a branch `mywork` on a remote-tracking branch
 `origin`, and create some commits on top of it:
 
 -------------------------------------------------
-$ git checkout -b mywork origin
+$ git switch -c mywork origin
 $ vi file.txt
 $ git commit
 $ vi otherfile.txt
@@ -2552,7 +2552,7 @@ commits without any merges, you may instead choose to use
 linkgit:git-rebase[1]:
 
 -------------------------------------------------
-$ git checkout mywork
+$ git switch mywork
 $ git rebase origin
 -------------------------------------------------
 
@@ -3668,13 +3668,13 @@ change within the submodule, and then update the superproject to reference the
 new commit:
 
 -------------------------------------------------
-$ git checkout master
+$ git switch master
 -------------------------------------------------
 
 or
 
 -------------------------------------------------
-$ git checkout -b fix-up
+$ git switch -c fix-up
 -------------------------------------------------
 
 then
@@ -4194,7 +4194,7 @@ start.
 A good place to start is with the contents of the initial commit, with:
 
 ----------------------------------------------------
-$ git checkout e83c5163
+$ git switch --detach e83c5163
 ----------------------------------------------------
 
 The initial revision lays the foundation for almost everything Git has
@@ -4437,10 +4437,10 @@ Managing branches
 -----------------
 
 -----------------------------------------------
-$ git branch	     # list all local branches in this repo
-$ git checkout test  # switch working directory to branch "test"
-$ git branch new     # create branch "new" starting at current HEAD
-$ git branch -d new  # delete branch "new"
+$ git branch			# list all local branches in this repo
+$ git switch test	        # switch working directory to branch "test"
+$ git branch new		# create branch "new" starting at current HEAD
+$ git branch -d new		# delete branch "new"
 -----------------------------------------------
 
 Instead of basing a new branch on current HEAD (the default), use:
@@ -4456,7 +4456,7 @@ $ git branch new test~10 # ten commits before tip of branch "test"
 Create and switch to a new branch at the same time:
 
 -----------------------------------------------
-$ git checkout -b new v2.6.15
+$ git switch -c new v2.6.15
 -----------------------------------------------
 
 Update and examine branches from the repository you cloned from:
@@ -4467,7 +4467,7 @@ $ git branch -r		# list
   origin/master
   origin/next
   ...
-$ git checkout -b masterwork origin/master
+$ git switch -c masterwork origin/master
 -----------------------------------------------
 
 Fetch a branch from a different repository, and give it a new
diff --git a/advice.c b/advice.c
index 567209aa79..457c1a255e 100644
--- a/advice.c
+++ b/advice.c
@@ -191,13 +191,16 @@ void NORETURN die_conclude_merge(void)
 void detach_advice(const char *new_name)
 {
 	const char *fmt =
-	_("Note: checking out '%s'.\n\n"
+	_("Note: switching to '%s'.\n"
+	"\n"
 	"You are in 'detached HEAD' state. You can look around, make experimental\n"
 	"changes and commit them, and you can discard any commits you make in this\n"
-	"state without impacting any branches by performing another checkout.\n\n"
+	"state without impacting any branches by switching back to a branch.\n"
+	"\n"
 	"If you want to create a new branch to retain commits you create, you may\n"
-	"do so (now or later) by using -b with the checkout command again. Example:\n\n"
-	"  git checkout -b <new-branch-name>\n\n");
+	"do so (now or later) by using -c with the switch command. Example:\n"
+	"\n"
+	"  git switch -c <new-branch-name>\n\n");
 
 	fprintf(stderr, fmt, new_name);
 }
diff --git a/sha1-name.c b/sha1-name.c
index a656481c6a..e5f0832995 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -745,7 +745,7 @@ static int get_oid_basic(const char *str, int len, struct object_id *oid,
 	"because it will be ignored when you just specify 40-hex. These refs\n"
 	"may be created by mistake. For example,\n"
 	"\n"
-	"  git checkout -b $br $(git rev-parse ...)\n"
+	"  git switch -c $br $(git rev-parse ...)\n"
 	"\n"
 	"where \"$br\" is somehow empty and a 40-hex ref is created. Please\n"
 	"examine these refs and maybe delete them. Turn this message off by\n"
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index 1fa670625c..f85dbd6740 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -195,16 +195,16 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
-	Note: checking out 'HEAD^'.
+	Note: switching to 'HEAD^'.
 
 	You are in 'detached HEAD' state. You can look around, make experimental
 	changes and commit them, and you can discard any commits you make in this
-	state without impacting any branches by performing another checkout.
+	state without impacting any branches by switching back to a branch.
 
 	If you want to create a new branch to retain commits you create, you may
-	do so (now or later) by using -b with the checkout command again. Example:
+	do so (now or later) by using -c with the switch command. Example:
 
-	  git checkout -b <new-branch-name>
+	  git switch -c <new-branch-name>
 
 	HEAD is now at \$commit three
 	EOF
@@ -271,16 +271,16 @@ test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked
 
 	# The first detach operation is more chatty than the following ones.
 	cat >1st_detach <<-EOF &&
-	Note: checking out 'HEAD^'.
+	Note: switching to 'HEAD^'.
 
 	You are in 'detached HEAD' state. You can look around, make experimental
 	changes and commit them, and you can discard any commits you make in this
-	state without impacting any branches by performing another checkout.
+	state without impacting any branches by switching back to a branch.
 
 	If you want to create a new branch to retain commits you create, you may
-	do so (now or later) by using -b with the checkout command again. Example:
+	do so (now or later) by using -c with the switch command. Example:
 
-	  git checkout -b <new-branch-name>
+	  git switch -c <new-branch-name>
 
 	HEAD is now at \$commit... three
 	EOF
-- 
2.20.1.682.gd5861c6d90
Previous: Duy NguyenNext: Nguyễn Thái Ngọc Duy
Message 69 of 289 in “Add new command "switch"”
  1. 00/19 Add new command "switch"Nguyễn Thái Ngọc Duy, Jan 30, 2019
  2. 01/19 git-checkout.txt: fix one syntax lineNguyễn Thái Ngọc Duy, Jan 30, 2019
  3. 02/19 doc: document --overwrite-ignoreNguyễn Thái Ngọc Duy, Jan 30, 2019
  4. 03/19 t: rename t2014-switch.sh to t2014-checkout-switch.shNguyễn Thái Ngọc Duy, Jan 30, 2019
  5. 04/19 checkout: factor out some code in parse_branchname_arg()Nguyễn Thái Ngọc Duy, Jan 30, 2019
  6. 05/19 checkout: make "opts" in cmd_checkout() a pointerNguyễn Thái Ngọc Duy, Jan 30, 2019
  7. 06/19 checkout: move 'confict_style' and 'dwim_..' to checkout_optsNguyễn Thái Ngọc Duy, Jan 30, 2019
  8. 07/19 checkout: split options[] array in three piecesNguyễn Thái Ngọc Duy, Jan 30, 2019
  9. 08/19 checkout: split part of it to new command switchNguyễn Thái Ngọc Duy, Jan 30, 2019
  10. Eric SunshineJan 31, 2019
  11. Duy NguyenJan 31, 2019
  12. Eric SunshineJan 31, 2019
  13. Eric SunshineJan 31, 2019
  14. Duy NguyenJan 31, 2019
  15. Eric SunshineJan 31, 2019
  16. git-commit.txt: better description what it doesNguyễn Thái Ngọc Duy, Jan 31, 2019
  17. Eric SunshineJan 31, 2019
  18. Duy NguyenJan 31, 2019
  19. Eric SunshineFeb 1, 2019
  20. git-commit.txt: better description what it doesNguyễn Thái Ngọc Duy, Feb 1, 2019
  21. Junio C HamanoFeb 4, 2019
  22. SZEDER GáborJan 31, 2019
  23. SZEDER GáborJan 31, 2019
  24. Duy NguyenFeb 8, 2019
  25. 09/19 switch: better names for -b and -BNguyễn Thái Ngọc Duy, Jan 30, 2019
  26. Eric SunshineJan 31, 2019
  27. 10/19 switch: remove -lNguyễn Thái Ngọc Duy, Jan 30, 2019
  28. 11/19 switch: stop accepting pathspecNguyễn Thái Ngọc Duy, Jan 30, 2019
  29. 12/19 switch: reject "do nothing" caseNguyễn Thái Ngọc Duy, Jan 30, 2019
  30. 13/19 switch: only allow explicit detached HEADNguyễn Thái Ngọc Duy, Jan 30, 2019
  31. 14/19 switch: add short option for --detachNguyễn Thái Ngọc Duy, Jan 30, 2019
  32. 15/19 switch: no implicit dwim, use --guess to dwimNguyễn Thái Ngọc Duy, Jan 30, 2019
  33. 16/19 switch: no worktree status unless real branch switch happensNguyễn Thái Ngọc Duy, Jan 30, 2019
  34. 17/19 t: add tests for switchNguyễn Thái Ngọc Duy, Jan 30, 2019
  35. Eric SunshineJan 31, 2019
  36. 18/19 completion: support switchNguyễn Thái Ngọc Duy, Jan 30, 2019
  37. 19/19 doc: promote "git switch"Nguyễn Thái Ngọc Duy, Jan 30, 2019
  38. Eric SunshineJan 31, 2019
  39. Duy NguyenJan 31, 2019
  40. SZEDER GáborJan 31, 2019
  41. Duy NguyenJan 31, 2019
  42. Junio C HamanoJan 31, 2019
  43. Duy NguyenFeb 2, 2019
  44. Junio C HamanoJan 31, 2019
  45. 00/19 Add new command "switch"Nguyễn Thái Ngọc Duy, Feb 8, 2019
  46. 01/19 git-checkout.txt: fix one syntax lineNguyễn Thái Ngọc Duy, Feb 8, 2019
  47. 02/19 doc: document --overwrite-ignoreNguyễn Thái Ngọc Duy, Feb 8, 2019
  48. 03/19 t: rename t2014-switch.sh to t2014-checkout-switch.shNguyễn Thái Ngọc Duy, Feb 8, 2019
  49. 04/19 checkout: factor out some code in parse_branchname_arg()Nguyễn Thái Ngọc Duy, Feb 8, 2019
  50. 05/19 checkout: make "opts" in cmd_checkout() a pointerNguyễn Thái Ngọc Duy, Feb 8, 2019
  51. 06/19 checkout: move 'confict_style' and 'dwim_..' to checkout_optsNguyễn Thái Ngọc Duy, Feb 8, 2019
  52. Junio C HamanoFeb 15, 2019
  53. 07/19 checkout: split options[] array in three piecesNguyễn Thái Ngọc Duy, Feb 8, 2019
  54. 08/19 checkout: split part of it to new command switchNguyễn Thái Ngọc Duy, Feb 8, 2019
  55. 09/19 switch: better names for -b and -BNguyễn Thái Ngọc Duy, Feb 8, 2019
  56. Eric SunshineFeb 11, 2019
  57. 10/19 switch: remove -lNguyễn Thái Ngọc Duy, Feb 8, 2019
  58. 11/19 switch: stop accepting pathspecNguyễn Thái Ngọc Duy, Feb 8, 2019
  59. 12/19 switch: reject "do nothing" caseNguyễn Thái Ngọc Duy, Feb 8, 2019
  60. 13/19 switch: only allow explicit detached HEADNguyễn Thái Ngọc Duy, Feb 8, 2019
  61. 14/19 switch: add short option for --detachNguyễn Thái Ngọc Duy, Feb 8, 2019
  62. 15/19 switch: no implicit dwim, use --guess to dwimNguyễn Thái Ngọc Duy, Feb 8, 2019
  63. Eric SunshineFeb 10, 2019
  64. 16/19 switch: no worktree status unless real branch switch happensNguyễn Thái Ngọc Duy, Feb 8, 2019
  65. 17/19 t: add tests for switchNguyễn Thái Ngọc Duy, Feb 8, 2019
  66. 18/19 completion: support switchNguyễn Thái Ngọc Duy, Feb 8, 2019
  67. SZEDER GáborFeb 8, 2019
  68. Duy NguyenFeb 9, 2019
  69. 19/19 doc: promote "git switch"Nguyễn Thái Ngọc Duy, Feb 8, 2019
  70. 00/21 Add new command "switch"Nguyễn Thái Ngọc Duy, Mar 8, 2019
  71. 01/21 git-checkout.txt: spell out --no-optionNguyễn Thái Ngọc Duy, Mar 8, 2019
  72. Eric SunshineMar 10, 2019
  73. 02/21 git-checkout.txt: fix one syntax lineNguyễn Thái Ngọc Duy, Mar 8, 2019
  74. 03/21 doc: document --overwrite-ignoreNguyễn Thái Ngọc Duy, Mar 8, 2019
  75. 04/21 git-checkout.txt: fix monospace typesetNguyễn Thái Ngọc Duy, Mar 8, 2019
  76. Martin ÅgrenMar 9, 2019
  77. Duy NguyenMar 11, 2019
  78. Martin ÅgrenMar 11, 2019
  79. 05/21 t: rename t2014-switch.sh to t2014-checkout-switch.shNguyễn Thái Ngọc Duy, Mar 8, 2019
  80. 06/21 checkout: factor out some code in parse_branchname_arg()Nguyễn Thái Ngọc Duy, Mar 8, 2019
  81. 07/21 checkout: make "opts" in cmd_checkout() a pointerNguyễn Thái Ngọc Duy, Mar 8, 2019
  82. 08/21 checkout: move 'confict_style' and 'dwim_..' to checkout_optsNguyễn Thái Ngọc Duy, Mar 8, 2019
  83. 09/21 checkout: split options[] array in three piecesNguyễn Thái Ngọc Duy, Mar 8, 2019
  84. 10/21 checkout: split part of it to new command 'switch'Nguyễn Thái Ngọc Duy, Mar 8, 2019
  85. Martin ÅgrenMar 9, 2019
  86. Jacob KellerMar 10, 2019
  87. Elijah NewrenMar 11, 2019
  88. Phillip WoodMar 11, 2019
  89. Duy NguyenMar 11, 2019
  90. Phillip WoodMar 11, 2019
  91. Duy NguyenMar 12, 2019
  92. Elijah NewrenMar 11, 2019
  93. Phillip WoodMar 11, 2019
  94. Elijah NewrenMar 11, 2019
  95. Phillip WoodMar 12, 2019
  96. Duy NguyenMar 12, 2019
  97. Eric SunshineMar 12, 2019
  98. Elijah NewrenMar 12, 2019
  99. Eric SunshineMar 12, 2019
  100. Junio C HamanoMar 13, 2019
  101. Duy NguyenMar 14, 2019
  102. Phillip WoodMar 14, 2019
  103. Duy NguyenMar 14, 2019
  104. Elijah NewrenMar 14, 2019
  105. Junio C HamanoMar 18, 2019
  106. Duy NguyenMar 18, 2019
  107. Elijah NewrenMar 18, 2019
  108. Duy NguyenMar 20, 2019
  109. Jacob KellerMar 15, 2019
  110. Duy NguyenMar 12, 2019
  111. Elijah NewrenMar 12, 2019
  112. Phillip WoodMar 14, 2019
  113. Duy NguyenMar 14, 2019
  114. Elijah NewrenMar 14, 2019
  115. Junio C HamanoMar 14, 2019
  116. Elijah NewrenMar 14, 2019
  117. Junio C HamanoMar 14, 2019
  118. Duy NguyenMar 14, 2019
  119. unpack-trees: fix oneway_merge accidentally carry over stage indexNguyễn Thái Ngọc Duy, Mar 17, 2019
  120. Junio C HamanoMar 18, 2019
  121. Duy NguyenMar 18, 2019
  122. Junio C HamanoMar 18, 2019
  123. unpack-trees: fix oneway_merge accidentally carry over stage indexNguyễn Thái Ngọc Duy, Mar 18, 2019
  124. Elijah NewrenMar 18, 2019
  125. Phillip WoodMar 19, 2019
  126. Junio C HamanoMar 20, 2019
  127. Duy NguyenMar 20, 2019
  128. Duy NguyenMar 26, 2019
  129. Elijah NewrenMar 26, 2019
  130. Duy NguyenMar 26, 2019
  131. Elijah NewrenMar 26, 2019
  132. Duy NguyenMar 26, 2019
  133. Phillip WoodMar 27, 2019
  134. Duy NguyenMar 28, 2019
  135. Elijah NewrenMar 28, 2019
  136. Phillip WoodMar 28, 2019
  137. Elijah NewrenMar 28, 2019
  138. Phillip WoodMar 29, 2019
  139. Duy NguyenMar 29, 2019
  140. Elijah NewrenMar 29, 2019
  141. Phillip WoodApr 25, 2019
  142. Junio C HamanoApr 1, 2019
  143. Elijah NewrenMar 11, 2019
  144. Phillip WoodMar 12, 2019
  145. Elijah NewrenMar 12, 2019
  146. Phillip WoodMar 14, 2019
  147. checkout.txt: note about losing staged changes with --mergeNguyễn Thái Ngọc Duy, Mar 19, 2019
  148. Phillip WoodMar 19, 2019
  149. Junio C HamanoMar 20, 2019
  150. Duy NguyenMar 20, 2019
  151. Junio C HamanoMar 20, 2019
  152. Duy NguyenMar 20, 2019
  153. Junio C HamanoMar 20, 2019
  154. Elijah NewrenMar 20, 2019
  155. Duy NguyenMar 20, 2019
  156. Elijah NewrenMar 21, 2019
  157. Junio C HamanoMar 21, 2019
  158. Duy NguyenMar 13, 2019
  159. Elijah NewrenMar 13, 2019
  160. 11/21 switch: better names for -b and -BNguyễn Thái Ngọc Duy, Mar 8, 2019
  161. 12/21 switch: remove -lNguyễn Thái Ngọc Duy, Mar 8, 2019
  162. 13/21 switch: stop accepting pathspecNguyễn Thái Ngọc Duy, Mar 8, 2019
  163. 14/21 switch: reject "do nothing" caseNguyễn Thái Ngọc Duy, Mar 8, 2019
  164. 15/21 switch: only allow explicit detached HEADNguyễn Thái Ngọc Duy, Mar 8, 2019
  165. 16/21 switch: add short option for --detachNguyễn Thái Ngọc Duy, Mar 8, 2019
  166. 17/21 switch: no implicit dwim, use --guess to dwimNguyễn Thái Ngọc Duy, Mar 8, 2019
  167. Eckhard MaaßMar 13, 2019
  168. Eric SunshineMar 15, 2019
  169. Duy NguyenMar 15, 2019
  170. Junio C HamanoMar 18, 2019
  171. Duy NguyenMar 16, 2019
  172. 18/21 switch: no worktree status unless real branch switch happensNguyễn Thái Ngọc Duy, Mar 8, 2019
  173. Eric SunshineMar 10, 2019
  174. 19/21 t: add tests for switchNguyễn Thái Ngọc Duy, Mar 8, 2019
  175. Eric SunshineMar 10, 2019
  176. Andrei RybakMar 10, 2019
  177. 20/21 completion: support switchNguyễn Thái Ngọc Duy, Mar 8, 2019
  178. 21/21 doc: promote "git switch"Nguyễn Thái Ngọc Duy, Mar 8, 2019
  179. Ramsay JonesMar 8, 2019
  180. Duy NguyenMar 9, 2019
  181. 00/26 Add new command 'switch'Nguyễn Thái Ngọc Duy, Mar 17, 2019
  182. 01/26 git-checkout.txt: spell out --no-optionNguyễn Thái Ngọc Duy, Mar 17, 2019
  183. 02/26 git-checkout.txt: fix one syntax lineNguyễn Thái Ngọc Duy, Mar 17, 2019
  184. 03/26 doc: document --overwrite-ignoreNguyễn Thái Ngọc Duy, Mar 17, 2019
  185. Martin ÅgrenMar 17, 2019
  186. 04/26 git-checkout.txt: fix monospace typesetNguyễn Thái Ngọc Duy, Mar 17, 2019
  187. Martin ÅgrenMar 17, 2019
  188. 05/26 t: rename t2014-switch.sh to t2014-checkout-switch.shNguyễn Thái Ngọc Duy, Mar 17, 2019
  189. 06/26 checkout: advice how to get out of detached HEAD modeNguyễn Thái Ngọc Duy, Mar 17, 2019
  190. 07/26 checkout: keep most #include sortedNguyễn Thái Ngọc Duy, Mar 17, 2019
  191. 08/26 checkout: factor out some code in parse_branchname_arg()Nguyễn Thái Ngọc Duy, Mar 17, 2019
  192. 09/26 checkout: make "opts" in cmd_checkout() a pointerNguyễn Thái Ngọc Duy, Mar 17, 2019
  193. 10/26 checkout: move 'confict_style' and 'dwim_..' to checkout_optsNguyễn Thái Ngọc Duy, Mar 17, 2019
  194. 11/26 checkout: split options[] array in three piecesNguyễn Thái Ngọc Duy, Mar 17, 2019
  195. 12/26 checkout: split part of it to new command 'switch'Nguyễn Thái Ngọc Duy, Mar 17, 2019
  196. Elijah NewrenMar 18, 2019
  197. 13/26 switch: better names for -b and -BNguyễn Thái Ngọc Duy, Mar 17, 2019
  198. 14/26 switch: add --discard-changesNguyễn Thái Ngọc Duy, Mar 17, 2019
  199. Eric SunshineMar 18, 2019
  200. 15/26 switch: remove -lNguyễn Thái Ngọc Duy, Mar 17, 2019
  201. 16/26 switch: stop accepting pathspecNguyễn Thái Ngọc Duy, Mar 17, 2019
  202. 17/26 switch: reject "do nothing" caseNguyễn Thái Ngọc Duy, Mar 17, 2019
  203. 18/26 switch: only allow explicit detached HEADNguyễn Thái Ngọc Duy, Mar 17, 2019
  204. 19/26 switch: add short option for --detachNguyễn Thái Ngọc Duy, Mar 17, 2019
  205. 20/26 switch: implicit dwim, use --no-guess to disable itNguyễn Thái Ngọc Duy, Mar 17, 2019
  206. 21/26 switch: no worktree status unless real branch switch happensNguyễn Thái Ngọc Duy, Mar 17, 2019
  207. 22/26 switch: reject if some operation is in progressNguyễn Thái Ngọc Duy, Mar 17, 2019
  208. Phillip WoodMar 20, 2019
  209. 23/26 switch: --orphan defaults to empty tree as HEADNguyễn Thái Ngọc Duy, Mar 17, 2019
  210. 24/26 t: add tests for switchNguyễn Thái Ngọc Duy, Mar 17, 2019
  211. 25/26 completion: support switchNguyễn Thái Ngọc Duy, Mar 17, 2019
  212. 26/26 doc: promote "git switch"Nguyễn Thái Ngọc Duy, Mar 17, 2019
  213. Duy NguyenMar 17, 2019
  214. Junio C HamanoMar 18, 2019
  215. Duy NguyenMar 18, 2019
  216. Junio C HamanoMar 19, 2019
  217. 00/26 Add new command 'switch'Nguyễn Thái Ngọc Duy, Mar 21, 2019
  218. 01/26 git-checkout.txt: spell out --no-optionNguyễn Thái Ngọc Duy, Mar 21, 2019
  219. 02/26 git-checkout.txt: fix one syntax lineNguyễn Thái Ngọc Duy, Mar 21, 2019
  220. 03/26 doc: document --overwrite-ignoreNguyễn Thái Ngọc Duy, Mar 21, 2019
  221. 04/26 git-checkout.txt: fix monospace typesetNguyễn Thái Ngọc Duy, Mar 21, 2019
  222. 05/26 t: rename t2014-switch.sh to t2014-checkout-switch.shNguyễn Thái Ngọc Duy, Mar 21, 2019
  223. 06/26 checkout: advice how to get out of detached HEAD modeNguyễn Thái Ngọc Duy, Mar 21, 2019
  224. 07/26 checkout: keep most #include sortedNguyễn Thái Ngọc Duy, Mar 21, 2019
  225. 08/26 checkout: factor out some code in parse_branchname_arg()Nguyễn Thái Ngọc Duy, Mar 21, 2019
  226. 09/26 checkout: make "opts" in cmd_checkout() a pointerNguyễn Thái Ngọc Duy, Mar 21, 2019
  227. 10/26 checkout: move 'confict_style' and 'dwim_..' to checkout_optsNguyễn Thái Ngọc Duy, Mar 21, 2019
  228. 12/26 checkout: split part of it to new command 'switch'Nguyễn Thái Ngọc Duy, Mar 21, 2019
  229. 13/26 switch: better names for -b and -BNguyễn Thái Ngọc Duy, Mar 21, 2019
  230. 14/26 switch: add --discard-changesNguyễn Thái Ngọc Duy, Mar 21, 2019
  231. 15/26 switch: remove -lNguyễn Thái Ngọc Duy, Mar 21, 2019
  232. 16/26 switch: stop accepting pathspecNguyễn Thái Ngọc Duy, Mar 21, 2019
  233. 11/26 checkout: split options[] array in three piecesNguyễn Thái Ngọc Duy, Mar 21, 2019
  234. 17/26 switch: reject "do nothing" caseNguyễn Thái Ngọc Duy, Mar 21, 2019
  235. 18/26 switch: only allow explicit detached HEADNguyễn Thái Ngọc Duy, Mar 21, 2019
  236. 19/26 switch: add short option for --detachNguyễn Thái Ngọc Duy, Mar 21, 2019
  237. 20/26 switch: implicit dwim, use --no-guess to disable itNguyễn Thái Ngọc Duy, Mar 21, 2019
  238. 21/26 switch: no worktree status unless real branch switch happensNguyễn Thái Ngọc Duy, Mar 21, 2019
  239. 22/26 switch: reject if some operation is in progressNguyễn Thái Ngọc Duy, Mar 21, 2019
  240. 23/26 switch: make --orphan switch to an empty treeNguyễn Thái Ngọc Duy, Mar 21, 2019
  241. 24/26 t: add tests for switchNguyễn Thái Ngọc Duy, Mar 21, 2019
  242. 25/26 completion: support switchNguyễn Thái Ngọc Duy, Mar 21, 2019
  243. 26/26 doc: promote "git switch"Nguyễn Thái Ngọc Duy, Mar 21, 2019
  244. Andrei RybakMar 22, 2019
  245. Duy NguyenMar 22, 2019
  246. Elijah NewrenMar 21, 2019
  247. Junio C HamanoMar 22, 2019
  248. Duy NguyenMar 22, 2019
  249. 00/27 Add new command 'switch'Nguyễn Thái Ngọc Duy, Mar 29, 2019
  250. 01/27 git-checkout.txt: spell out --no-optionNguyễn Thái Ngọc Duy, Mar 29, 2019
  251. 02/27 git-checkout.txt: fix one syntax lineNguyễn Thái Ngọc Duy, Mar 29, 2019
  252. 03/27 doc: document --overwrite-ignoreNguyễn Thái Ngọc Duy, Mar 29, 2019
  253. 04/27 git-checkout.txt: fix monospace typesetNguyễn Thái Ngọc Duy, Mar 29, 2019
  254. 05/27 t: rename t2014-switch.sh to t2014-checkout-switch.shNguyễn Thái Ngọc Duy, Mar 29, 2019
  255. 06/27 checkout: advice how to get out of detached HEAD modeNguyễn Thái Ngọc Duy, Mar 29, 2019
  256. 07/27 checkout: inform the user when removing branch stateNguyễn Thái Ngọc Duy, Mar 29, 2019
  257. SZEDER GáborJul 2, 2019
  258. Duy NguyenJul 2, 2019
  259. SZEDER GáborJul 2, 2019
  260. Junio C HamanoJul 2, 2019
  261. Duy NguyenJul 4, 2019
  262. 08/27 checkout: keep most #include sortedNguyễn Thái Ngọc Duy, Mar 29, 2019
  263. 09/27 checkout: factor out some code in parse_branchname_arg()Nguyễn Thái Ngọc Duy, Mar 29, 2019
  264. 10/27 checkout: make "opts" in cmd_checkout() a pointerNguyễn Thái Ngọc Duy, Mar 29, 2019
  265. 11/27 checkout: move 'confict_style' and 'dwim_..' to checkout_optsNguyễn Thái Ngọc Duy, Mar 29, 2019
  266. 12/27 checkout: split options[] array in three piecesNguyễn Thái Ngọc Duy, Mar 29, 2019
  267. 13/27 checkout: split part of it to new command 'switch'Nguyễn Thái Ngọc Duy, Mar 29, 2019
  268. 14/27 switch: better names for -b and -BNguyễn Thái Ngọc Duy, Mar 29, 2019
  269. 15/27 switch: add --discard-changesNguyễn Thái Ngọc Duy, Mar 29, 2019
  270. Phillip WoodApr 25, 2019
  271. Duy NguyenApr 25, 2019
  272. Phillip WoodApr 29, 2019
  273. 16/27 switch: remove -lNguyễn Thái Ngọc Duy, Mar 29, 2019
  274. 17/27 switch: stop accepting pathspecNguyễn Thái Ngọc Duy, Mar 29, 2019
  275. 18/27 switch: reject "do nothing" caseNguyễn Thái Ngọc Duy, Mar 29, 2019
  276. 19/27 switch: only allow explicit detached HEADNguyễn Thái Ngọc Duy, Mar 29, 2019
  277. 20/27 switch: add short option for --detachNguyễn Thái Ngọc Duy, Mar 29, 2019
  278. 21/27 switch: implicit dwim, use --no-guess to disable itNguyễn Thái Ngọc Duy, Mar 29, 2019
  279. 22/27 switch: no worktree status unless real branch switch happensNguyễn Thái Ngọc Duy, Mar 29, 2019
  280. 23/27 switch: reject if some operation is in progressNguyễn Thái Ngọc Duy, Mar 29, 2019
  281. Elijah NewrenMar 29, 2019
  282. Phillip WoodApr 25, 2019
  283. Duy NguyenApr 29, 2019
  284. Phillip WoodApr 29, 2019
  285. 24/27 switch: make --orphan switch to an empty treeNguyễn Thái Ngọc Duy, Mar 29, 2019
  286. 25/27 t: add tests for switchNguyễn Thái Ngọc Duy, Mar 29, 2019
  287. 26/27 completion: support switchNguyễn Thái Ngọc Duy, Mar 29, 2019
  288. 27/27 doc: promote "git switch"Nguyễn Thái Ngọc Duy, Mar 29, 2019
  289. Elijah NewrenMar 29, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.