Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is what you're looking for: <a href="http://gitready.com/beginner/2009/03/06/ignoring-doesnt-remove-a-file.html" rel="noreferrer">ignoring doesn't remove a file</a>. I suggest you read that page, but here's the specific command to use:</p> <pre class="lang-bash prettyprint-override"><code>git filter-branch --index-filter \ 'git rm -r --cached --ignore-unmatch &lt;file/dir&gt;' HEAD </code></pre> <p>Also, to remove all the deleted files from caches git creates, use:</p> <pre class="lang-bash prettyprint-override"><code>rm -rf .git/refs/original/ &amp;&amp; \ git reflog expire --all &amp;&amp; \ git gc --aggressive --prune </code></pre> <p>You can find more info about the last command, as well as a script that does everything you want in one single action, here: <a href="http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history" rel="noreferrer">git: forever remove files or folders from history</a>.</p> <p>Another links with lots of explanation: <a href="http://help.github.com/removing-sensitive-data" rel="noreferrer">Remove sensitive data</a>.</p> <p><strong>[Edit]</strong> Also, see this StackOverflow question: <a href="https://stackoverflow.com/questions/872565/how-do-i-remove-sensitive-files-from-gits-history">Remove sensitive files and their commits from Git history</a>. </p> <p>(Commands copied from <code>natacado</code>'s answer in the question linked above.) If you have already removed the files from the working copy, the following should work. Find out the hash for the commit that added the unwanted files. Then do:</p> <pre class="lang-bash prettyprint-override"><code>git filter-branch --index-filter \ 'git update-index --remove filename' &lt;introduction-revision-sha1&gt;..HEAD git push --force --verbose --dry-run git push --force </code></pre>
    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