I have a remote bare git repository.
A new developer cloned it, but he didn’t have a properly configured .gitignore file, so he mistakenly pushed some unwanted files into the remote. When I pulled the changes and merged, I got these previously untracked files. Others have also pulled the changes from the remote and have these unwanted files as well.
How do I delete these files from the remote repository, and everyone else’s remote/origin/branches?
This is a three step process:
git rmor by totally purging these files from your history depending on how important it was that these files never be in the repository in the first place)git push --force.git rebaseof their work on the last know good commit.As a last step you may also want to add the
.gitignorefile to the repository so that when the repository is cloned all the right files get ignored.