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.
*log
.gitignore
A more generic solution:
Edit .gitignore file.
echo mylogfile.log >> .gitignore
Remove all items from index.
git rm -r -f --cached .
Rebuild index.
git add .
Make new commit
git commit -m "Removed mylogfile.log"