I think I figured out how to do this.  Before running git filter-branch 
..., first do git rm --cached filename and check in that commit.  That 
removes the files from the HEAD index, but leaves them as untracked files 
in the directory. Now run git filter-branch to remove all occurrences of 
the files from from history.  

On Friday, March 20, 2015 at 11:19:23 PM UTC-7, joeri...@gmail.com wrote:
> I want to remove certain files from the index of a git repository, but 
> retain them in the directory.They should be removed from all branches, that 
> is, when finished they should exist as untracked files.  I tried using git 
> filter-branch with git-rm --cached, as described in 
> https://help.github.com/articles/remove-sensitive-data/, however, that 
> removed them from the directory.  I could restore the files (from the 
> original, I'm working in a clone, of course), but am wondering why git-rm 
> --cached removed the working files.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to