summaryrefslogtreecommitdiff
path: root/t/t2020-checkout-detach.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-03-29 10:39:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-02 04:57:00 (GMT)
commit328c6cb853d7237098569de9f94bc3d259846a08 (patch)
tree2c60dadbceba1dca728bc74fd14100f4dc71178d /t/t2020-checkout-detach.sh
parentae36fe694180ad2646983d43c5bf12841ac2db47 (diff)
downloadgit-328c6cb853d7237098569de9f94bc3d259846a08.zip
git-328c6cb853d7237098569de9f94bc3d259846a08.tar.gz
git-328c6cb853d7237098569de9f94bc3d259846a08.tar.bz2
doc: promote "git switch"
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... The "Checking out files" progress line in unpack-trees.c is also updated to "Updating files" to be neutral to both git-checkout and git-switch. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2020-checkout-detach.sh')
-rwxr-xr-xt/t2020-checkout-detach.sh24
1 files changed, 12 insertions, 12 deletions
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index 743c724..b748db9 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -195,20 +195,20 @@ 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>
- Or undo this checkout with:
+ Or undo this operation with:
- git checkout -
+ git switch -
Turn off this advice by setting config variable advice.detachedHead to false
@@ -277,20 +277,20 @@ 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>
- Or undo this checkout with:
+ Or undo this operation with:
- git checkout -
+ git switch -
Turn off this advice by setting config variable advice.detachedHead to false