Sam Posted April 12, 2019 Report Share Posted April 12, 2019 Hi everybody, I'm afraid I did a big mistake on one of my repo. I have a repo called "My_repo_A" which has a XLinked sub repo called "My_repo_A_shares". This sub repo "My_repo_A_shares" is synced with a repo on github. But tonight, after a hard work week, I synced by mistake the parent repo "My_repo_A" with the same repo on github. That resulted in a warning like "the branches have to be merged before being able to push with gitsync again ...". Hopefully there are no problems on github, but in plastic a lot of commits are duplicated with different guid, and branches have two heads ... So ... the winner is me ! I know ... but is there a way to cancel a gitsync ? Thanks a lot for your help. Link to comment Share on other sites More sharing options...
calbzam Posted April 15, 2019 Report Share Posted April 15, 2019 Hi, If you get duplicated items and the repo history is broken, I would remove this repo and perform a new clean gitsync to recover the right history. As soon as the Github history is ok, you should be able to sync to a new repo. Regards, Carlos. Link to comment Share on other sites More sharing options...
Sam Posted April 16, 2019 Author Report Share Posted April 16, 2019 Hi Carlos, The sub-repo synced with github is OK, but it's the "parent" plastic repo that has been accidentally sinced with github mirror image of its child repo. There is no github image of the parent repository. Perhaps there's a way to detect all the commit that come from gitsync and delete them ? Sincerly Sam T. Link to comment Share on other sites More sharing options...
calbzam Posted April 16, 2019 Report Share Posted April 16, 2019 Hi, If you open the branch explorer, are you able to determine the duplicated changesets? How many duplicated changesets are there? It may be difficult to remove all of them one by one :$ Don't you have repo backups? Also, I don't understand how this scenario could happen. For the GitSync operation, Plastic uses a local mappings folder. This way if a PlasticRepo1 is synced with GitRepo1 and then you try to sync the same repo against GitRepo2, Plastic doesn't allow it to prevent rewriting the history or duplicating changesets. Once you sync a Plastic repo with a Git repo, you cannot choose to sync a different one. Regards, Carlos. Link to comment Share on other sites More sharing options...
Sam Posted April 29, 2019 Author Report Share Posted April 29, 2019 Hi Carlos, I finally deleted all the wrong commits by hand. Hopefully all the changesets numbers were consecutive (even all was mixed up in the timeline) so it was not that hard to detect them. On 4/16/2019 at 6:40 PM, calbzam said: Also, I don't understand how this scenario could happen. For the GitSync operation, Plastic uses a local mappings folder. This way if a PlasticRepo1 is synced with GitRepo1 and then you try to sync the same repo against GitRepo2, Plastic doesn't allow it to prevent rewriting the history or duplicating changesets. Once you sync a Plastic repo with a Git repo, you cannot choose to sync a different one. There's a protection against two GitRepos to be synced on one Plastic repo, not against what I did by mystake : two PlasticRepos synced with the same GitRepo, moreover one of the two PlasticRepo was a submodule of the other PlasticRepo. Thanks for help Link to comment Share on other sites More sharing options...
calbzam Posted April 29, 2019 Report Share Posted April 29, 2019 Ok, thanks for the update. If I properly understand, after removing the duplicated changesets, the repo is up and running again. Regards, Carlos. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now