Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

GitMerge for Unity - Merge your scene files for free

Discussion in 'Assets and Asset Store' started by FlaSh-G, Dec 16, 2014.

  1. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    Hi there.

    Everyone who uses git (or any other vcs) with Unity probably ran across the problem that scene merging is not exactly possible. On gamejams, we just agreed on yelling locks on scene files out loud :)

    There is a tool called UniMerge in the Asset Store, available for $15, which allows you to merge scenes. Since I think this is a really important feature to have, I decided to create my own merge tool editor extension, and make it free and open source.There are still some things to do, but it has reached a state where I think I can tell you about it, so you can try it and give feedback.
    It currently only works with git. I'll see if there's interest in changing that.

    The tool looks pretty much like this:


    You can get more information (including insctructions) here: http://flashg.github.io/GitMerge-for-Unity/
    The project itself is here: https://github.com/FlaShG/GitMerge-for-Unity

    I'd love to hear from you if you use this or even have feedback.
    If you want to improve stuff, don't hesitate to make pull requests.
    Check the github issues to see what's next on the menu.

    Greetings :)
     
    Last edited: Dec 16, 2014
    rakkarage likes this.
  2. red2blue

    red2blue

    Joined:
    Feb 26, 2013
    Posts:
    200
    Haven't tried it so far, but want to say THANK YOU for your work and sharing it with the community! Really nice of you!
     
  3. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    Happy new year everyone!
    I used the last few days to improve the feature set of this tool. You can now merge prefabs and arrays :D

    Also, the UI, even though it has room for improvements, works pretty fine now on most parts imo.
    I'll continue to work on the rough edges here. Next up is a major refactoring of the main window class.
    But apart from that, I think that the tool is ready to be used in your project.
    As always, I'd love to hear from you about it!
     
  4. tsubaki_t1

    tsubaki_t1

    Joined:
    Jul 2, 2012
    Posts:
    29
    awsome!
     
  5. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    116
    Awesome, we are going to test this right away !

    Edit : I have a problem using the tool. I created 2 branches and made changes to the same scene and prefab, for testing purposes. However, merging the scene is duplicating all the objects in the hierarchy root (this happens as soon as I press "Start merging this scene" and is not cancelled by a "abort merge"). I'm in merge state within git

    Edit 2 : Weird, i can click on "start merging this scene" even if I'm not in a merging state.... and the same duplicating problem happens
     
    Last edited: Feb 3, 2015
  6. sacha

    sacha

    Joined:
    Oct 29, 2012
    Posts:
    22
    Thanks for that tool !
     
  7. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    @RDeluxe: Do you get any error messages? This sounds like an exception being thrown while the merge is being initialized.

    The tool does open the other version of the scene additively, but should make the objects added completely invisible before you could even notice.
     
  8. B-Mills

    B-Mills

    Joined:
    Mar 28, 2013
    Posts:
    14
    Thank you so much for sharing this tool. I will give it a try later on, it sounds incredibly useful.
     
  9. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    116
    @FlaSh.G Hi. No sadly I don't have any errors.
    I tried again today with a good example : I changed the hierarchy of my scene from (ours) :
    • UIRootCanvas
      • Camp
    • EventSystem
    To (theirs, as it's a rebase) :
    • MyScene
      • UIRootCanvas
      • Camp
      • EventSystem

    Here is the result choosing all theirs (because I want this new hierarchy) :



    As you can see there is a duplication.

    Edit : Wo, it seems that it's the same object, but displayed twice (selecting one selects the other, and expanding one expands the other).

    Edit 2 : Saving, closing unity and opening the scene again makes the wrong duplicate disappear. So it's some kind of display glitch ! Good :D
    I'm going to try a new merge, as I may have made mistakes in this one (some of "theirs" changes have not been applied correctly). I may have been to quick during the process.

    Edit 3 : Sadly is seems that a lot of my changes (theirs, in this case, as it is a rebase) are not displayed. I can't explain why. I removed and added a components to a UIButton for example, which is somewhere inside UIRootCanvas. This change is not displayed anywhere (I assure you it exists :D ). This is really weird.
     
    Last edited: Feb 19, 2015
  10. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    You are among the few people who give me feedback for this, so I'm not surprised there are some situations I never even tested for :)

    Do you use the most current version of the tool? Within the last few weeks, a lot has been changed and added in terms of added/deleted objects and parenting. Maybe the problem's gone already? If not, please feel free to check the project's issue page and support the development there!
     
  11. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    116
    Hi,

    I downloaded the latest version from Github before trying today. So I guess it's the last one (Master).

    I took a look at the issue page and did not find anything related, but I'll look again and post there !
     
  12. bloeys

    bloeys

    Joined:
    Aug 26, 2014
    Posts:
    57
    Hi,
    First I want to thank you for making this available to all, awesome job!

    I'm facing a problem when merging, I have done exactly what the instructions say, I got a conflict and in the merging state of Git I opened the window and clicked start merging scenes, but I always get this error:

    "ArgumentException: An element with the same key already exists in the dictionary."

    Two extra scenes are being created, 'OURS' and 'THEIRS', but nothing further happens as it stops at the error on top, I hope you can help me fix this.
     
  13. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    Hi there,

    I guess you are using Unity 5?
    The tool doesn't work at all in Unity 5, since a really tiny detail has been changed - and that breaks everything.
    Please vote here to have this changed again in a future Unity version.
     
  14. bloeys

    bloeys

    Joined:
    Aug 26, 2014
    Posts:
    57
    Oh damn that's not good, it seems it is going to take a long time.
    Thanks for telling me, I have already voted, really hope they fix it.
    Is there a way to safely merge scenes, it is really annoying to work while only one can work on the scene at a time, I have searched a lot but it seems no one can find a proper way, not even with the unity team license.
     
  15. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    There is an Asset called UniMerge in the Asset Store that is supposed to do just that. GitMerge was inspired by that package. I'm not sure how well it works in Unity 5 though.

    Other than that, if there was a nice way to do it, I wouldn't have started this project :)
     
  16. bloeys

    bloeys

    Joined:
    Aug 26, 2014
    Posts:
    57
    Ya I know about it, though I was hoping for a free solution, and I wonder the same thing, whether it is still functional.
    Thanks for your help anyway, please keep us updated if unity reverts their change.
    :)
     
  17. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    I sure hope to be able to do so soon ;)
     
    bloeys likes this.