Git fork

doc: git-checkout: split up restoring files section

From user feedback: one user mentioned that "When the <tree-ish> (most
often a commit) is not given" is confusing since it starts with a
negative.

Restructuring so that `git checkout main file.txt` and
`git checkout file.txt` are separate items will help us simplify the
sentence structure a lot.

As a bonus, it appears that `-f` actually only applies to one of those
forms, so we can include fewer options, and now the structure of the
DESCRIPTION matches the SYNOPSIS.

Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Julia Evans and committed by
Junio C Hamano
bfe7b17c 0dd71f60

+13 -10
+13 -10
Documentation/git-checkout.adoc
··· 12 12 git checkout [-q] [-f] [-m] --detach [<branch>] 13 13 git checkout [-q] [-f] [-m] [--detach] <commit> 14 14 git checkout [-q] [-f] [-m] [[-b|-B|--orphan] <new-branch>] [<start-point>] 15 - git checkout [-f] <tree-ish> [--] <pathspec>... 16 - git checkout [-f] <tree-ish> --pathspec-from-file=<file> [--pathspec-file-nul] 15 + git checkout <tree-ish> [--] <pathspec>... 16 + git checkout <tree-ish> --pathspec-from-file=<file> [--pathspec-file-nul] 17 17 git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [--] <pathspec>... 18 18 git checkout [-f|--ours|--theirs|-m|--conflict=<style>] --pathspec-from-file=<file> [--pathspec-file-nul] 19 19 git checkout (-p|--patch) [<tree-ish>] [--] [<pathspec>...] ··· 72 72 + 73 73 Omitting _<branch>_ detaches `HEAD` at the tip of the current branch. 74 74 75 - `git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <pathspec>...`:: 76 - `git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] --pathspec-from-file=<file> [--pathspec-file-nul]`:: 75 + `git checkout <tree-ish> [--] <pathspec>...`:: 76 + `git checkout <tree-ish> --pathspec-from-file=<file> [--pathspec-file-nul]`:: 77 + 78 + Overwrite both the index and the working tree with the 79 + contents at the _<tree-ish>_ for the files that match the pathspec. 80 + 81 + `git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [--] <pathspec>...`:: 82 + `git checkout [-f|--ours|--theirs|-m|--conflict=<style>] --pathspec-from-file=<file> [--pathspec-file-nul]`:: 77 83 78 - Overwrite the contents of the files that match the pathspec. 79 - When the _<tree-ish>_ (most often a commit) is not given, 80 - overwrite working tree with the contents in the index. 81 - When the _<tree-ish>_ is given, overwrite both the index and 82 - the working tree with the contents at the _<tree-ish>_. 84 + Overwrite working tree with the contents in the index for the files 85 + that match the pathspec. 83 86 + 84 87 The index may contain unmerged entries because of a previous failed merge. 85 88 By default, if you try to check out such an entry from the index, the ··· 90 93 file can be discarded to re-create the original conflicted merge result. 91 94 92 95 `git checkout (-p|--patch) [<tree-ish>] [--] [<pathspec>...]`:: 93 - This is similar to the previous mode, but lets you use the 96 + This is similar to the previous two modes, but lets you use the 94 97 interactive interface to show the "diff" output and choose which 95 98 hunks to use in the result. See below for the description of 96 99 `--patch` option.