diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-04-25 16:45:58 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-07 13:04:48 +0900 |
commit | 80f537f79c16efeb7b92b3409ede434a230b5679 (patch) | |
tree | 28b73ceb285fde7cec4ef84c4b685534887397c3 /builtin | |
parent | user-manual.txt: prefer 'merge --abort' over 'reset --hard' (diff) | |
download | tgif-80f537f79c16efeb7b92b3409ede434a230b5679.tar.xz |
doc: promote "git restore"
The new command "git restore" (together with "git switch") are added
to avoid the confusion of one-command-do-all "git checkout" for new
users. They are also helpful to avoid ambiguous context.
For these reasons, promote it everywhere possible. This includes
documentation, suggestions/advice from other commands.
One nice thing about git-restore is the ability to restore
"everything", so it can be used in "git status" advice instead of both
"git checkout" and "git reset". The three commands suggested by "git
status" are add, rm and restore.
"git checkout" is also removed from "git help" (i.e. it's no longer
considered a commonly used command)
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 'builtin')
-rw-r--r-- | builtin/clone.c | 2 | ||||
-rw-r--r-- | builtin/commit.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 50bde99618..024eb57996 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -492,7 +492,7 @@ static enum { static const char junk_leave_repo_msg[] = N_("Clone succeeded, but checkout failed.\n" "You can inspect what was checked out with 'git status'\n" - "and retry the checkout with 'git checkout -f HEAD'\n"); + "and retry with 'git restore --source=HEAD :/'\n"); static void remove_junk(void) { diff --git a/builtin/commit.c b/builtin/commit.c index f17537474a..fa5982cc86 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1676,7 +1676,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) if (commit_index_files()) die(_("repository has been updated, but unable to write\n" "new_index file. Check that disk is not full and quota is\n" - "not exceeded, and then \"git reset HEAD\" to recover.")); + "not exceeded, and then \"git restore --staged :/\" to recover.")); if (git_env_bool(GIT_TEST_COMMIT_GRAPH, 0)) write_commit_graph_reachable(get_object_directory(), 0, 0); |