gitgit-extensions

Push to one remote repository only in a multi remote repository local repository


Using an old version of Git Extensions (2.49)

I just tried to cherry pick multiple changes from a secondary remote repository to my local reposity and primary remote repository.

Doing so, I added the second remote repository over "Repository" -> "Remote repositories" -> "New" and so on.

This lead, as expected, to Git Extensions to show both remote trees and all changes from primary and secondary. I was able to easily cherry pick and merge my changes from secondary in the same view, shown as different remote branches. First everything looked fine and I was able to create new feature branches on local and do the work and push to primary remote.

Later, after a fetch all, I found out the secondary remote repository has also "received" the full tree of the primary. Even from a different local repositry, where just the secondary is linked in and used, I still see the whole data of primary now.

That lead to big troubles for me and I am currently trying to find out what was going on.

In the "Push" dialog, every time there is this dropdown where I can select one remote repository. Alternatively, it is possible to push to an URL but this I have not used. I am pretty sure that I have always selected the primary repository there. But still, all changes and even the whole history was pushed to secondary. I would have expected that when I select one remote repository at a push, that the data really just goes to that repository and no other remote.

Question 1:

What was my mistake?

Question 2:

How can I fix the secondary repository and remove everything that was copied from primary?

Can I somehow choose one commit and remove it and all it's childrens? This should be a method to remove the primary branch from secondary.

I really hope you can help since I was working in a team and now the whole repo is a total mess due to my changes. xD

Thanks.

Edit 1:

Question 3:

For next time, is it possible to add a secondary remote repository as read only? That would have prevented that problem.


Solution

  • Sorry for the confusion. I think I found out what was going on.

    As said, I was using a really old version of Git Extensions (2.49). It seems that this version was very buggy or has compatibility issues with my setup.

    The problem was that the Repository config dialog window was behaving strange. I added the second repository there and later I found out, that the original remote repository was also changed the same URL as the secondary. This lead to the situation that both configs, primary and secondary were pointing in the reality to the secondary URL and I was pushing to secondary. After a fetch the GUI looked like it was pushed to both, prim and second.

    After that conclusion I played around with this dialog and it just behaves completely strange. Sometimes the URL gets removed after saving, sometimes it saves the URL to a different remote repository entry, sometimes it works. Strange.

    I decided to go the illegal path (company policy) and downloaded the newest portable variant of Git Extensions. Here everything works perfectly fine and as expected.

    Even the secondary repo was fixed. It is a Gerrit server and there you have an web frontend where I was able to choose the accidentially pushed branches from secondary. After that, the whole orphan commit tree disappeard again.

    So everything is fixed now. :-D

    Thanks for the help.