0

I have made a big mess while merging two different development branch with master branch. After merging the data from both the branches to master,i simply compare both development branch with master and pull the new changes from master to both the development branch. i don't know why but it gives me partial changes from both the developers, at the end i manually merged all the changes to a new local project for which i don't have any repositories, My question is

how can i synchronize back the changes to my remote repositories?

To answer this question i tried few things, which is listed below.

  1. I committed and pushed all the changes to new "development-3" branch and then try to merge it with master but stuck in Conflicts, which i am not able to solve, because it gives me conflicts in 50-60% files of projects, besides i don't have idea of any good compare and merge tool for Unity Game Engine, and if by any chance if i get any good tool then also it increases my overhead of conflicts when i already have a working project which is manually integrated.

  2. I tried to clone and repository again but stuck at the same problem of conflicts.

  3. I tried manually integrating the project into new cloned repository and then try to push all the changes back to master, but this also fails because of conflicts.

From what i understand and experience, now i left with two questions where i need help from community.

  1. How to override all the changes in master with local project? and i don't want to create new repository because i have releases in my current repositories. [My all hopes are on this option]

  2. The number of conflicts are really huge, any better option or diff & merge tool which i can use with Unity to solve the conflicts?

Kartik Shah
  • 143
  • 2
  • 5
  • 14
  • Unity has its own version control tool, for free, called Unity collaborate. It's part of unity teams – Jichael Nov 20 '19 at 13:26
  • Yeah, but it gives 1GB of cloud space in free edition and it's not that efficient. :( – Kartik Shah Nov 20 '19 at 13:28
  • 1
    It doesn't answer your question but you should have a look at this interesting question about Git with Unity: https://stackoverflow.com/questions/18225126/how-to-use-git-for-unity3d-source-control – Ludovic Feltz Nov 20 '19 at 13:36
  • I really appreciate your help and thanks for trying to help me out, sadly this is something i know but not helps me out. – Kartik Shah Nov 20 '19 at 13:39
  • I don't think their is a tool for merging Unity files... But some files aren't necessary (only files in /Assets/ folder a really needed). Merge your scripts files manually and reimport all your scene one by one... – Ludovic Feltz Nov 20 '19 at 13:40
  • When working with other people on Unity project each developer should have separate scene then theses differents scene can be opened simultaneously. [Multiscene editing](https://docs.unity3d.com/Manual/MultiSceneEditing.html) – Ludovic Feltz Nov 20 '19 at 13:42
  • @LudovicFeltz I agree and i follow that approach only but developer-1 added two new scene in project which is not there in developer-2's local computer and he made some mistake while pushing the changes to repo and that created a big mess. – Kartik Shah Nov 20 '19 at 15:33
  • So reset to a previous commit? Or use reflogs if he messed the logs – Ludovic Feltz Nov 20 '19 at 15:54

1 Answers1

0

Well if you really want to use that repo, and don't want to change your new local version then you:

  1. Checkout the same project in another folder.

  2. Then select all files in that folder and delete then.

  3. Make a commit of those file deletions(basically removing them from the repo), if unclear what you should do you are basically telling the repo that file is gone.

  4. Then just paste you local files into the empty repo folder and make a commit adding those new files.

Milos Romanic
  • 457
  • 3
  • 12