From: Junio C Hamano Date: Thu, 11 Jul 2019 22:16:48 +0000 (-0700) Subject: Merge branch 'sg/git-C-empty-doc' X-Git-Tag: v2.23.0-rc0~49 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/df73cb38d942d2fb305a0fbfedd9a093ca386c83?hp=-c Merge branch 'sg/git-C-empty-doc' Doc update. * sg/git-C-empty-doc: Document that 'git -C ""' works and doesn't change directory --- df73cb38d942d2fb305a0fbfedd9a093ca386c83 diff --combined Documentation/git.txt index e095514ace,81f7ecd52c..9b82564d1a --- a/Documentation/git.txt +++ b/Documentation/git.txt @@@ -33,8 -33,7 +33,8 @@@ individual Git commands with "git help manual page gives you an overview of the command-line command syntax. A formatted and hyperlinked copy of the latest Git documentation -can be viewed at `https://git.github.io/htmldocs/git.html`. +can be viewed at https://git.github.io/htmldocs/git.html +or https://git-scm.com/docs. OPTIONS @@@ -57,7 -56,8 +57,8 @@@ help ...` Run as if git was started in '' instead of the current working directory. When multiple `-C` options are given, each subsequent non-absolute `-C ` is interpreted relative to the preceding `-C - `. + `. If '' is present but empty, e.g. `-C ""`, then the + current working directory is left unchanged. + This option affects options that expect path name like `--git-dir` and `--work-tree` in that their interpretations of the path names would be @@@ -211,26 -211,6 +212,26 @@@ people via patch over e-mail include::cmds-foreignscminterface.txt[] +Reset, restore and revert +~~~~~~~~~~~~~~~~~~~~~~~~~ +There are three commands with similar names: `git reset`, +`git restore` and `git revert`. + +* linkgit:git-revert[1] is about making a new commit that reverts the + changes made by other commits. + +* linkgit:git-restore[1] is about restoring files in the working tree + from either the index or another commit. This command does not + update your branch. The command can also be used to restore files in + the index from another commit. + +* linkgit:git-reset[1] is about updating your branch, moving the tip + in order to add or remove commits from the branch. This operation + changes the commit history. ++ +`git reset` can also be used to restore the index, overlapping with +`git restore`. + Low-level commands (plumbing) -----------------------------