On 30/11/12 15:36, Chris Green wrote:
As per the subject - if I am maintaining a set of files in a directory and one of them is no longer used then I would do "git rm <name of file>" and then when I commit the file is no longer in the current version of the repository.
I assume however that it would be possible to get back the last (and previous) committed version of the file if I needed ot at some time in the future?
man git-rm "git-rm - Remove files from the working tree and from the index"
So they are still in the history and can be recovered using: git checkout <commit> -- <file>
To remove a file completely from history you need to something like what's described in: http://git-scm.com/book/ch6-4.html#The-Nuclear-Option:-filter-branch but even that leaves stuff around for a while so to completely remove a a file immediately you need to do stuff like in: http://stackoverflow.com/questions/872565/remove-sensitive-files-and-their-c...
You do have backups, right? :)
Hope that helps, Mike.