I have an interesting problem at hand. In a shared team repo, a team member added a remote to a completely unrelated repository (this was an accident).
e.g.
git remote add foreign-remote https://github.com/some-open-source-project
He checkout out the master branch of that repo and pushed it to our repo.
e.g.
git checkout foreign-remote/master
git checkout -b experiment
git push origin experiment
This created effectively two unrelated sub-graphs within the team repo:
The left part is our proper code, the right part is that foreign repository.
How can we completely remove that right part? It is not causing any harm but it is very annoying and I would like to get rid of this sub-graph, preferably without leaving any traces behind.
Also, is there a way of preventing this from happening?