Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code> git mv common include </code></pre> <p>should work.</p> <p>From the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-mv.html" rel="noreferrer"><code>git mv</code> man page</a>:</p> <pre><code>git mv [-f] [-n] [-k] &lt;source&gt; ... &lt;destination directory&gt; </code></pre> <blockquote> <p>In the second form, the last argument has to be an existing directory; <strong>the given sources will be moved into this directory</strong>.<br> The index is updated after successful completion, but the change must still be committed.</p> </blockquote> <p>No "<code>git add</code>" should be done <em>before</em> the move.</p> <hr> <p>Note: "<code>git mv A B/</code>", when <code>B</code> does not exist as a directory, should error out, but it didn't.</p> <p>See <a href="https://github.com/git/git/commit/c57f6281ff847db7094d708f5c5b939d378f7120" rel="noreferrer">commit c57f628</a> by <a href="https://github.com/moy" rel="noreferrer">Matthieu Moy (<code>moy</code>)</a> for <a href="https://github.com/git/git/blob/b10cd577d8061912996576a096e2fd5503c770e6/Documentation/RelNotes/1.9.txt#L144-L146" rel="noreferrer">Git 1.9/2.0</a> (Q1 2014):</p> <blockquote> <p>Git used to trim the trailing slash, and make the command equivalent to '<code>git mv file no-such-dir</code>', which created the file <code>no-such-dir</code> (while the trailing slash explicitly stated that it could only be a directory).</p> <p>This patch skips the trailing slash removal for the destination path.<br> The path with its trailing slash is passed to rename(2), which errors out with the appropriate message:</p> </blockquote> <pre><code>$ git mv file no-such-dir/ fatal: renaming 'file' failed: Not a directory </code></pre>
 

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