Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This isn't a bug, it's documented behaviour. From <code>man git-clean</code>:</p> <blockquote> <p>If an untracked directory is managed by a different git repository, it is not removed by default.</p> </blockquote> <p>The <code>submod</code> directory is a different <code>git</code> repository; if you want to remove it, <code>Use -f option twice if you really want to remove such a directory</code>. </p> <p><code>git clean -f -f -d submod</code> <em>does</em> remove <code>submod</code>. See my steps below (almost identical; different <code>git version</code> and hard-coded <code>submodule</code> path because otherwise <code>git</code> spits the dummy). </p> <hr> <h2>Steps</h2> <pre><code> $ git --version git version 1.7.5.4 # Note, different git-version. </code></pre> <h3>Make the two repositories</h3> <pre><code> git init submod cd submod echo "This is a submodule" > README.txt git add . git commit -m "Initial commit" cd .. git init prog cd prog echo "This is a program" > README.txt git add . git commit -a -m "Initial commit" </code></pre> <h3>Add <code>submod</code> as a <code>git submodule</code> in <code>topic1</code> branch.</h3> <pre><code> git checkout -b topic1 git submodule add /Users/simont/sandbox/SOTESTING/Subdir-testing/submod git commit -m "Added submodule" </code></pre> <h3>Now for the interesting section.</h3> <pre><code> $ git checkout master warning: unable to rmdir submod: Directory not empty Switched to branch 'master' git status # On branch master # Untracked files: # (use "git add ..." to include in what will be committed) # # submod/ #nothing added to commit but untracked files present (use "git add" to track) </code></pre> <h3>Attempt to <code>git-clean</code>, then <em>actually</em> <code>git-clean</code>.</h3> <pre><code> git clean -fd #Removing submod/ git status # On branch master # Untracked files: # (use "git add ..." to include in what will be committed) # # submod/ #nothing added to commit but untracked files present (use "git add" to track) $ # As we can see, we haven't actually removed anything yet. $ ls README.txt submod $ git clean -f -f -d submod Removing submod/ $ ls README.txt $ git status # On branch master nothing to commit (working directory clean) </code></pre>
    singulars
    1. This table or related slice is empty.
    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