Jump to content

Cannot replicate because the two Plastic repositories are in sync with git


Lazlo

Recommended Posts

Hi,

We tried setting up GitSync in order to use Unity Cloud Build.

We made the mistake of syncing from our local repositories instead of the cloud repository.

This created duplicated heads and changesets because the GitSync-ed GUIDs were different, which makes sense.

(By the way, it's not clear at all in the Unity Cloud Build interop tutorial that we should not git sync from local repos. The screenshot even shows syncing from a local repo in the GUI. The command line command is good, but the screenshot isn't).

To fix the duplicated heads and changesets, we manually deleted all the changesets one by one.

However, now, when we try to pull from the cloud, we get this error:

Quote

The sync process was unable to replicate the following branch:

Branch: /main
Operation: Pull
Source repository: *****@*****@cloud
Destination repository: *****@local

Error description: 
Cannot replicate because the two Plastic repositories are in sync with git (or replicated from the originally synced repos). Only one repo can be in sync at the time. The repositories originally synchronized are '*****@local - https://bitbucket.org/*****/*****.git' and '*****@local - https://bitbucket.org/*****/*****.git'. Please contact support for further info.

I don't know how to fix this.

I basically want to go back to a clean slate and get rid of all Git Sync configuration and history on all machines to start over.

From this StackOverflow answer, I tried deleting all subfolders under C:\Users\UserName\AppData\Local\plastic4\sync\git.

That did not solve the issue.

So I have two questions:

  • How can I fix this and start pulling from the cloud again?
  • How can I GitSync with the Plastic GUI (not the command line) from the cloud repo when working on a replicated local repository?

Thanks!

Link to comment
Share on other sites

Hi,

- We have this restriction (only one repo can be in sync with git) to avoid duplicating the repo histotry (I guess this is the problem you faced). 

The Gitsync operation needs to be run always between the same Plastic and git repos and also you need to run the operation from the same Plastic client.  The GitSync mappings are locally stored in the %LocalAppData% folder. This way, the next time you run GitSync, only the pending to sync changesets will be pushed.

- If you want to start the GitSync from scratch, you can remove the %LocalAppData% folder and also the "git-repo-sync" attribute. But it's very important that you also create a new clean git repo for that purpose. Otherwise, the history of the repo will be duplicated (breaking it). Once the mappings folder is created again, you can continue performing incremental syncs.

- There is not restriction for the cloud repos. The GitSync process is exactly the same for a cloud or a local repo. You can create a workspace directly pointing to the cloud repo and then run GitSync from the branch explorer menu. Or you can run the GitSync via CLI as well.

Regards,

Carlos.

Link to comment
Share on other sites

Hi Carlos, thanks for the quick reply.

I'll recreate a new Git repo on my provider.

Is there a way to Git Sync between the Cloud repo and the Git host from the GUI without having to download the files? (Sometimes it's multi GB projects for us).

(Basically this other workspace setup would only be to trigger the git sync).

Otherwise I'll just create a batch file to run the sync.

Link to comment
Share on other sites

Oh also, re: the reasoning for the limitation I understand, but somehow it didn't keep us from creating a duplicated head.

The workflow was:

  • Replicated repo on Machine A
  • Replicated repo on Machine B
  • GitSync from Machine A
  • GitSync from Machine B

 

Link to comment
Share on other sites

Please don't use multiple machines to run the GitSync between a specific Plastic-git repos. You need to always use the same one as the mappings a locally saved (on the client side).

If you want to run GitSync from a different machine (or remove the local mappings folder for some reason), so will need to create a new clean git repo and start the operation from scratch. Otherwise, the repo hisotry will be duplicated.

 

Quote

 

Is there a way to Git Sync between the Cloud repo and the Git host from the GUI without having to download the files? (Sometimes it's multi GB projects for us).

(Basically this other workspace setup would only be to trigger the git sync).

Otherwise I'll just create a batch file to run the sync.

 

If the Gitsync goal is to use Unity cloud build, I recommend to automatize the process via batch. This way, you don't need to create a Plastic workspace or run any manual operation.

By the way, did you find a git provider that fit your needs?

Regards,

Carlos.

Link to comment
Share on other sites

Thanks, I'll create a batch file then.

Unfortunately I couldn't find a Git hosting provider that supports >10GB repos and >100MB files without LFS enabled. They all offer paid data plans that could scale to these levels, but only for LFS enabled repos.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...