summaryrefslogtreecommitdiffstats
path: root/gitcli.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-12 15:56:53 -0700
committerJunio C Hamano <gitster@pobox.com>2012-09-12 15:56:53 -0700
commit693e70961ac5a79a46303795f3ca6a0bfd62f375 (patch)
tree70fc25a554a7d96d42e8d233d57316d63f603c47 /gitcli.html
parenteccdd4a4b39010678cef09a1c28c964396d2cc84 (diff)
downloadgit-htmldocs-693e70961ac5a79a46303795f3ca6a0bfd62f375.tar.gz
Autogenerated HTML docs for v1.7.12-395-g6b149
Diffstat (limited to 'gitcli.html')
-rw-r--r--gitcli.html25
1 files changed, 22 insertions, 3 deletions
diff --git a/gitcli.html b/gitcli.html
index 846812e3f..ed2c4cbf7 100644
--- a/gitcli.html
+++ b/gitcli.html
@@ -618,11 +618,30 @@ Without disambiguating <tt>--</tt>, git makes a reasonable guess, but errors
you have to say either <tt>git diff HEAD --</tt> or <tt>git diff -- HEAD</tt> to
disambiguate.
</p>
-</li>
-</ul></div>
<div class="paragraph"><p>When writing a script that is expected to handle random user-input, it is
a good practice to make it explicit which arguments are which by placing
disambiguating <tt>--</tt> at appropriate places.</p></div>
+</li>
+<li>
+<p>
+Many commands allow wildcards in paths, but you need to protect
+ them from getting globbed by the shell. These two mean different
+ things:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git checkout -- *.c
+$ git checkout -- \*.c</tt></pre>
+</div></div>
+<div class="paragraph"><p>The former lets your shell expand the fileglob, and you are asking
+the dot-C files in your working tree to be overwritten with the version
+in the index. The latter passes the <tt>*.c</tt> to Git, and you are asking
+the paths in the index that match the pattern to be checked out to your
+working tree. After running <tt>git add hello.c; rm hello.c</tt>, you will <em>not</em>
+see <tt>hello.c</tt> in your working tree with the former, but with the latter
+you will.</p></div>
+</li>
+</ul></div>
<div class="paragraph"><p>Here are the rules regarding the "flags" that you should follow when you are
scripting git:</p></div>
<div class="ulist"><ul>
@@ -785,7 +804,7 @@ information.</p></div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2012-08-22 12:54:47 PDT
+Last updated 2012-09-12 15:56:23 PDT
</div>
</div>
</body>