Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is one of the git gotchas <a href="https://stackoverflow.com/questions/1597278/what-git-gotchas-have-you-been-caught-by/2117202#2117202">mentioned here</a> (pre Git 2.0).</p> <p><code>git add .</code> only adds what is there, not what has been deleted (if tracked).</p> <pre><code>git add . git commit git status //hey! why didn't it commit my deletes?, Oh yeah, silly me git add -u . git commit --amend </code></pre> <p><code>git add -A</code> would take care of both steps...</p> <hr> <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</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> <hr> <p>Warning (<a href="https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.3.txt#L19-L30" rel="noreferrer">git1.8.3 April 2013, for upcoming git2.0</a>).<br> I have modified my answer to say <code>git add -u .</code>, instead of <code>git add -u</code>.:</p> <blockquote> <p><code>git add -u</code> will <strong>operate on the entire tree</strong> in Git 2.0 for consistency with "<code>git commit -a</code>" and other commands.<br> Because there will be no mechanism to make "<code>git add -u</code>" behave as "<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> </blockquote> <p>As I mentioned in "<a href="https://stackoverflow.com/a/16162511/6309">e</a>"</p>
    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. 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.
 

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