summaryrefslogtreecommitdiffstats
path: root/gitcli.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2008-07-02 03:06:38 +0000
committerJunio C Hamano <junio@hera.kernel.org>2008-07-02 03:06:38 +0000
commitfce7c7e1549d1a2a2b0faf5952378236eed4d468 (patch)
treeffce2ae419b52786a0e567f4fddaadd89016f62c /gitcli.txt
parentbb8e996adf4293a0b624fe77e95e12ae8d1faed9 (diff)
downloadgit-htmldocs-fce7c7e1549d1a2a2b0faf5952378236eed4d468.tar.gz
Autogenerated HTML docs for v1.5.6.1-156-ge903b
Diffstat (limited to 'gitcli.txt')
-rw-r--r--gitcli.txt38
1 files changed, 37 insertions, 1 deletions
diff --git a/gitcli.txt b/gitcli.txt
index 231604986..29e5929db 100644
--- a/gitcli.txt
+++ b/gitcli.txt
@@ -133,9 +133,45 @@ $ git describe --abbrev 10 HEAD # NOT WHAT YOU MEANT
----------------------------
+NOTES ON FREQUENTLY CONFUSED OPTIONS
+------------------------------------
+
+Many commands that can work on files in the working tree
+and/or in the index can take `--cached` and/or `--index`
+options. Sometimes people incorrectly think that, because
+the index was originally called cache, these two are
+synonyms. They are *not* -- these two options mean very
+different things.
+
+ * The `--cached` option is used to ask a command that
+ usually works on files in the working tree to *only* work
+ with the index. For example, `git grep`, when used
+ without a commit to specify from which commit to look for
+ strings in, usually works on files in the working tree,
+ but with the `--cached` option, it looks for strings in
+ the index.
+
+ * The `--index` option is used to ask a command that
+ usually works on files in the working tree to *also*
+ affect the index. For example, `git stash apply` usually
+ merges changes recorded in a stash to the working tree,
+ but with the `--index` option, it also merges changes to
+ the index as well.
+
+`git apply` command can be used with `--cached` and
+`--index` (but not at the same time). Usually the command
+only affects the files in the working tree, but with
+`--index`, it patches both the files and their index
+entries, and with `--cached`, it modifies only the index
+entries.
+
+See also http://marc.info/?l=git&m=116563135620359 and
+http://marc.info/?l=git&m=119150393620273 for further
+information.
+
Documentation
-------------
-Documentation by Pierre Habouzit.
+Documentation by Pierre Habouzit and the git-list <git@vger.kernel.org>.
GIT
---