diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:44 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:44 -0700 |
| commit | f496b064fc1135e0dded7f93d85d72eb0b302c22 (patch) | |
| tree | 2149d0faf99c67ddd76a6d68125037f661db48a5 /Documentation/gitcli.txt | |
| parent | Merge branch 'nd/fetch-capability-tweak' (diff) | |
| parent | completion: disable dwim on "git switch -d" (diff) | |
| download | git-f496b064fc1135e0dded7f93d85d72eb0b302c22.tar.gz git-f496b064fc1135e0dded7f93d85d72eb0b302c22.zip | |
Merge branch 'nd/switch-and-restore'
Two new commands "git switch" and "git restore" are introduced to
split "checking out a branch to work on advancing its history" and
"checking out paths out of the index and/or a tree-ish to work on
advancing the current history" out of the single "git checkout"
command.
* nd/switch-and-restore: (46 commits)
completion: disable dwim on "git switch -d"
switch: allow to switch in the middle of bisect
t2027: use test_must_be_empty
Declare both git-switch and git-restore experimental
help: move git-diff and git-reset to different groups
doc: promote "git restore"
user-manual.txt: prefer 'merge --abort' over 'reset --hard'
completion: support restore
t: add tests for restore
restore: support --patch
restore: replace --force with --ignore-unmerged
restore: default to --source=HEAD when only --staged is specified
restore: reject invalid combinations with --staged
restore: add --worktree and --staged
checkout: factor out worktree checkout code
restore: disable overlay mode by default
restore: make pathspec mandatory
restore: take tree-ish from --source option instead
checkout: split part of it to new command 'restore'
doc: promote "git switch"
...
Diffstat (limited to 'Documentation/gitcli.txt')
| -rw-r--r-- | Documentation/gitcli.txt | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt index 592e06d839..1ed3ca33b7 100644 --- a/Documentation/gitcli.txt +++ b/Documentation/gitcli.txt @@ -47,8 +47,8 @@ disambiguating `--` at appropriate places. things: + -------------------------------- -$ git checkout -- *.c -$ git checkout -- \*.c +$ git restore *.c +$ git restore \*.c -------------------------------- + The former lets your shell expand the fileglob, and you are asking @@ -209,6 +209,18 @@ See also http://marc.info/?l=git&m=116563135620359 and http://marc.info/?l=git&m=119150393620273 for further information. +Some other commands that also work on files in the working tree and/or +in the index can take `--staged` and/or `--worktree`. + +* `--staged` is exactly like `--cached`, which is used to ask a + command to only work on the index, not the working tree. + +* `--worktree` is the opposite, to ask a command to work on the + working tree only, not the index. + +* The two options can be specified together to ask a command to work + on both the index and the working tree. + GIT --- Part of the linkgit:git[1] suite |
