My initial commit contained some log files. I\'ve added *log
to my .gitignore
, and now I want to remove the log files from my repository.
This depends on what you mean by 'remove' from git. :)
You can unstage a file using git rm --cached see for more details. When you unstage something, it means that it is no longer tracked, but this does not remove the file from previous commits.
If you want to do more than unstage the file, for example to remove sensitive data from all previous commits you will want to look into filtering the branch using tools like the BFG Repo-Cleaner.