I have found this answer and it helped:
git filter-branch --index-filter \
'git rm -rf --cached --ignore-unmatch path_to_file' HEAD
Found it here https://myopswork.com/how-remove-files-completely-from-git-repository-history-47ed3e0c4c35
More Related Contents:
- Error when pushing amended commit to remote [duplicate]
- How to do a GitHub pull request
- Git, fatal: The remote end hung up unexpectedly
- Download a single folder or directory from a GitHub repo
- Download single files from GitHub
- Only use a proxy for certain git urls/domains?
- Git: Recover deleted (remote) branch
- How much of a git sha is *generally* considered necessary to uniquely identify a change in a given codebase?
- git – how to get default branch?
- SSH Key – Still asking for password and passphrase
- How can I check out a GitHub pull request with git?
- What is a bare repository and why would I need one?
- Set Git submodule to shallow clone & sparse checkout?
- A way to restrict Git branch access?
- Can I arrange repositories into folders on Github?
- Is there a way to lock individual files or directories on fork when using git?
- fatal: The current branch master has no upstream branch
- Create new pull request from fork without having commits of the previous fork
- How to delete the last n commits on Github and locally?
- How to merge the remote branch and ignore the config setting?
- GitHub Clone with OAuth Access Token
- Git Clone – Repository not found
- How to push changes to github after jenkins build completes?
- Git: How to make outer repository and embedded repository work as common/standalone repository?
- GitHub pages only showing ReadMe file?
- Clone only the .git directory of a git repo
- How to push different local Git branches to Heroku/master
- git – remote add origin vs remote set-url origin
- git clone with HTTPS or SSH remote?
- when you have secret key in your project, how can pushing to GitHub be possible?