Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With <a href="https://github.com/git/git/blob/f99a38c0121456822f8a9dfb7928eefceaa98201/Documentation/RelNotes/2.0.0.txt#L32-L36" rel="noreferrer"><strong>Git 2.0, <code>git add -A</code> is default: <code>git add .</code> equals <code>git add -A .</code></strong></a>. </p> <blockquote> <p><code>git add &lt;path&gt;</code> is the same as "<code>git add -A &lt;path&gt;</code>" now, so that "<code>git add dir/</code>" will notice paths you removed from the directory and record the removal.<br> In older versions of Git, "<code>git add &lt;path&gt;</code>" used to ignore removals. </p> <p>You can say "<code>git add --ignore-removal &lt;path&gt;</code>" to add only added or modified paths in <code>&lt;path&gt;</code>, if you really want to.</p> </blockquote> <p><code>git add</code> is like <code>git add :/</code> (<a href="https://stackoverflow.com/a/31951899/6309">add everything from top git repo folder</a>).<br> Note that git 2.7 (Nov. 2015) will allow you to add a folder named "<code>:</code>"!<br> See <a href="https://github.com/git/git/commit/29abb33978f713cd0a5cc3687bf61077b0928840" rel="noreferrer">commit 29abb33</a> (25 Oct 2015) by <a href="https://github.com/gitster" rel="noreferrer">Junio C Hamano (<code>gitster</code>)</a>. </p> <hr> <p>Note that <a href="https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.3.txt#L19-L30" rel="noreferrer">starting git 2.0 (Q1 or Q2 2014)</a>, when talking about <strong><code>git add .</code></strong> (current path within the working tree), you must use '<code>.</code>' in the other <code>git add</code> commands as well.</p> <p>That means:</p> <blockquote> <p>"<code>git add -A .</code>" is equivalent to "<code>git add .; git add -u .</code>"</p> </blockquote> <p>(Note the extra '<code>.</code>' for <code>git add -A</code> and <code>git add -u</code>)</p> <p>Because <code>git add -A</code> or <code>git add -u</code> would operate (starting git 2.0 only) on the <strong>entire working tree</strong>, and not just on the current path.</p> <blockquote> <p>Those commands will <strong>operate on the entire tree in Git 2.0 for consistency with "<code>git commit -a</code>" and other commands</strong>. Because there will be no mechanism to make "<code>git add -u</code>" behave as if "<code>git add -u .</code>", it is important for those who are used to "<code>git add -u</code>" (without pathspec) updating the index only for paths in the current subdirectory to start training their fingers to explicitly say "<code>git add -u .</code>" when they mean it before Git 2.0 comes.</p> <p><strong>A warning is issued when these commands are run without a pathspec and when you have local changes outside the current directory</strong>, because the behaviour in Git 2.0 will be different from today's version in such a situation.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload