Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Branch and Merge
brucebartlett
Member, OS Professional, Mentor, User Group Leader Posts: 2,141 PRO
Is anyone successfully using the branch and merge? Normally I keep clear of trying to merge 2 branches but this time they got away from me. With this project, I am collaborating with 2 other users and I am trying to merge about 6 hrs of work together across various part studios and assemblies from 2 separate branches. When merging all I seem to get is copies of the alternative branches and can not seem to find a method to retain the parts I want from each other. Keen to hear others experiences or solutions.
Tagged:
1
Comments
My guess is that user adoption of branching and merging is less than onshape expected.
I believe it has been mentioned before, but some kind of selective merge would be very helpful in the situation that it sounds like you are in. If you could pick and pull pieces/parts from different branches for a combined merge. However, I can see this getting messy on OnShapes side of things as to where to make the cut for parts that reference others, etc.
Here are a few reasons why I have switched back to just working on the main.
- It is very easy to accidentally work on the node of the main branch when everything should be done on the dev. Especially with collaborators.
- Documents have to be set up at the start to avoid adding versions on the main branch. Easier just to start work and avoid versioning for as long as possible to keep tree clean.
- Branches including your DEV branch can be accidentally deleted losing your work
- Merge across to main sometimes fails for me.
- Collaborator views the main instead of the DEV and you have to explain about the dev branch.
- I lose track of the merges and worry the wrong work has ended up in the wrong spot on big documents.
For branching now I try to only use it for those times I want to compare a few different design scenarios off a version, not put to much work on a branch and merge before too much has been added on the main branch. I am also trying to prune branches back where possible and reasonably soon after creation to keep thing cleaner.Twitter: @onshapetricks & @babart1977
I end up going back into the merged REL and find a bunch of crap that I got rid of in DEV.
I know it is a system that only adds the two together. But I would like a replace option as well as merge.
What I expect is REL is the latest revision of DEV, rather than merging the branch then going back into REL and purging all of the features/tabs that you removed during development.
Only time I find myself using branches is for support tickets or complete re-designs
IR for AS/NZS 1100
HWM-Water Ltd
HWM-Water Ltd
@mlaflecheCAD , I already read this article more than once.
@brucebartlett , I agree with all your reasons, especially #1, 2, 5 and 6.
@john_mcclary , I agree branching adds work.
I first thought branching was going to be a good thing to explore many layouts in parallel while starting the design of a new robotic cell (which is what I do everyday). The problem is I can't modify a sub-assembly in a branch and merge only this modified sub-assembly to another branch if both branches are very different. I have to create a branch just to modify this sub-assembly so it means I have to plan exactly in advance where I want the modification to take place.
See image where both layouts are separate branches and where I would like to test a different rack design. I have to decide if I want to test it in only one layout or in both layouts before I even make a single change to the rack itself. This example is simple but when I'm making many (more than 2) layouts for a customer, it turns very complicated to follow branches...
Am I missing something?
In Onshape, you can "kill and replace" a branch in exactly those two steps
First, open (double click) the moment before the branch point, and click the "Restore to Main" text at the top. This reverts all changes to main that have occurred since the branch point, restoring Main to that previous state without the unwanted changes.
Second, go back to main, right-click B1, and select "Merge into current workspace".
After these two steps, your main branch should be in exactly the same state as B1.
Thanks for making the explanation simple. I will need to experiment with that now
HWM-Water Ltd
When working with others and branching, it becomes difficult to know which branch has the 'good stuff'. Naming the branch is critical to finding it later. Many branches just end and trying to remember the branches with the good stuff becomes problematic. We're deleting the workspaces at the end of dead branches to help designate which branches went no where.
I know github's branches always merge back to main, I'm still wondering why my OS branches don't.
All in all, I'm expecting my branch/merge diagram to look pristine like in the demo, but in reality it's typically a mess. Maybe over time, it'll look better.
Merging works when:
-dealing with a limited number of changes (20 features or changes) in a branch
-being extremely careful what I do in the branch to be merged
-not changing colors or other little details
-stay focused on the one change
Merging works when I know why I created the branch and I know what it's merging with. Typically it's a low number of changes that do something specific. If I begin to change colors or clean up stuff that's not part of my original plan, it blows up.
Taking a weeks worth of work and merging, doesn't work for me.
@kevin_o_toole_1 thanks for the example showing how to kill the main before merging this is a good option however it would be great if you could actually turn the main node of for a dev branch workflow.
Here are some examples of my dev branches, I haven't used Release management on any of these yet but that's another great use too.
There is also the power to do lots other things with branches too but takes alot of planning to make it successful, otherwise, you end up with a mess
Twitter: @onshapetricks & @babart1977
I still don't like the above branch&merge diagram because it's hard to understand that I've given up on these other branches.
Below I prune the tree:
Now it's obvious which workspace is valid. Also notice that if a workspace had no versions, they're totally gone. I like this. If I want to reactivate a dead branch I can create a new branch from one of the dead versions and reactivate the branch.
I'm learning to name everything and there are no versions without a name. I don't use versions as a save, but as a marker before and after I do something. I try to describe what I'm going to do and what I've done and mark when the design is valid/stable. Clicking on a version will bring you to state that has no errors and was something completed.
I don't use the 'B' designators for branches, but naming them is extremely important. Why are you branching? This is what I ask myself. 3 weeks from now I won't remember why I branched.
It's seems to be working for me, not sure it's right for you, but I thought I'd share.
Yes, great point Bill, you can see from my example above with heaps of branches & versions, I have totally lost what has been done and I am reluctant to delete/prune because I fear losing work. If I had planned better and used more names and descriptions it would make life a lot easier to sort through the work and prune un-needed braches.
Twitter: @onshapetricks & @babart1977
I have a few dozen live documents representing several common projects that I'm currently working on. Each document has 3 or 4 branches and finding the correct workspace is becoming an issue for me. Couple this with not being able to preview inside documents and their workspaces when choosing which document to open, I was forced to remember where things were. For me, remembering where things are isn't a good workflow. I've never liked that a branch becomes the active workspace forcing me to remember which workspace I should be in. Putting things back in main is a good workflow and I'll put more effort into this.
Your dev & rel branches, are these released and develop? Is release is your main branch? I'm still trying to wrap my head around your work flow. You could have rel & dev1 & dev2 & dev3 for 3 possible solutions that'll end up is rel?
I have had 2 active branches and I've wanted new changes to end up in both branches. I did use a 3rd branch for the changes and successfully merged them into each active branch. I deleted the 3rd branch after the merge and it did work. I think I was successful because my 3rd branch was a small amount of changes. This seems like a valid workflow.
Currently my approach to building projects in OS is to keep things simple. I have small projects that are scaling up nicely with more power than I've ever had before, but I'm restraining myself trying everything in OS, but instead, I'm taking a conservative approach to figure out what works and what doesn't.
Not everything is rosy in my camp. The other day I moved the wrong document into another document. When moving it back, I forgot to move it into the correct workspace. Everything I did was making things worse. Messed everything up and instead of correcting it, I just restored to a previous version which I don't like to do. This isn't OS fault, it's just learning a new system and knowing what to watch for.
So....
Move the frame into it's own document.
I think I'd try and keep an assembly in one document and then have a document for your frame. In the frame document I'd branch it to the nines with all the ideas you have for the frame.
Warning, when using 2 documents, OS will invoke versioning/updating and at 1st you'll think it's a pain. After a while you'll start to like it and begin to accept it. I didn't want to use it at 1st, but someone I work with forced it on me and now it's part of my standard work flow. I'm using multiple documents for very simple projects and have to restrain myself from over using it.
To move your frame to it's own document, just RMB the tab and move it to it's own document.
You'll have to update your assembly with versions of the branched frame. I think this is good because when in front of your customer, you just dance through your assembly versions showing the differing frames. You won't have 2 assemblies, rather 2 versions of the assembly. I'd put some thought into naming the versions. I've posted enough about this already.
Once you're done, move the frame back into to your single document. FYI, the branch/merge tree goes away when you move it back so pick the right frame when moving back. This might be what you want. If you want to keep the history, leave your 2 documents intact.
I'm not sure how many people are putting documents inside documents and possibly this should be another forum thread. I think it might be the key to get your situation to work and might explode into a way to control all these variations you're looking for.
Please let me know if my crazy idea works.
As discussed with Onshape support team, probably assembly configurations will resolve my problem. I'm waiting for it!
Basics for GIT Branch & Merge paradigm:
In your example with many unknown workspaces:
Anyway I've been cleaning this stuff up:
GIT seems to have it's own problems and issues similar to our issues but they seem to have some etiquette to their process that allows it to work. I'm not an expert at either but willing to share experiences. With the right process, I think this will become a powerful tool.
Twitter: @onshapetricks & @babart1977
Yesterday I started a new document vs. branching an existing design. I think the tendency is to gather everything into one document using branches, but I'm not sure this is the best practice. Not certain what the rule should be for branching vs adding more documents.