I need some info on branches (SOLVED)

So I have a project that I am currently working on which required me to create a new branch for the work I was doing.

After finishing this work I wanted to merge the branch into my main branch but when I looked through Defold Editor, there was nothing about merging anywhere? I tried looking through the forums, documentation and googling about. I wasnt able to find any answers to how branches are supposed to be merged.

I then switched to my main branch and ran sync on it, and suddenly it had all the changes from my feature branch, without me having ever managed to merge anything.

So my question is, what is a branch in defold? what is the purpose if it just gets automatically merged to other branches aswell? Any information you guys have would be great, also info on how the intended workflow is for actual branches so that I dont risk syncing code that might break other features.

1 Like

A “branch” is a local clone. If you need to do proper branching you need to use an external git tool or run git from command line. See http://www.defold.com/manuals/workflow/#_git

3 Likes

Interesting.

If I understand correctly, another way to create a non-destructive branch would be to first create a local snapshot branch, then create the branch you wish to edit and begin working, synchronizing to master as you go, but if you wanted to return to the original, sync the snapshot?

No, in your example, your snapshot would be updated with what you had done before. It’s just like @sicher says, a git clone, so that you have the repo cloned to multiple places in your file system. A sync in either of these local repos would merge the remote repo into it, and then commit/push any changes. The only useful thing for this is when you want to test something you don’t want to push into the remote repo yet. The design of the “local branches” was an attempt to a) make it easier for users not accustomed to version control, and b) solve a technical issue regarding locations in the file system. It has caused a great deal of confusion instead and has been removed clompletely in Editor2. In both the current editor and Editor2, you can work with branches more naturally like @sicher described.

2 Likes

Awesome thanks, that was just the info I was looking for. Now to figure out how to mark this post as answered.

Is there a current release date for Editor2? Or a stableish beta version o.o

You can help us beta test the new editor: Defold Editor 2.0

2 Likes