I had a problems with git changes and git repositories in Xcode. I solved the problem with this:
1 - I deleted from xcode project all files added from another projects by menu: File > Add file to your project
I believe the Xcode automatically add related projects in git changes and repositories when you do this.
2 - I disabled the git source control in menu: Xcode > Settings > Source Control tab > enable source control button
3 - I closed the Xcode and clean the cash using the DevCleaner software avaiable on App Store.
4 - Enable source control again and the projects its gonna be removed and just the main repository you are working it was avaiable.
Xcode version: 15.0
Mac version: 14.1.2