Can I merge changes from a master into a fork? | Observable Suggestions

Hi Observable Community,

I’ve read through the Observable Guide to Forking, Sharing, and Merging and I am clear on how to merge in changes from others, but what about merging changes from a ‘master’ branch into my fork?

Ben (@palewire) has edited his First Observable Notebook since I made a suggestion about what appears to be an errant link, and now my diff is showing me as removing text that he added to his notebook since my suggestion. I want my proposed edit to stand out from these diffs, and I wouldn’t mind merging in the changes that he made, but I don’t see a ‘merge’ available in my fork.

Am I missing something or is this not (yet?) part of Observable suggestions?

This platform gets better every day. Thanks Tom, Jeremy & Mike!

1 Like

I think if Ben visits the diff link, he should see a message: “Missing changes. The target is missing some base changes. Apply them below?”. This gives him the option to put changes from his “master” (the base) notebook back into the target before he merges. If I understand the merge system properly, you won’t see this since you don’t own the “base” notebook.

However, I think you can select “Compare reverse” from the upper-right menu, and then you should be able to select changes to merge back into your target? You might even see the “Missing changes” message too, though I’m not sure…

To be honest, I still find the “Missing changes…” message a little confusing and unintuitive. When I first saw it, I thought that hitting “Apply” would commit a change to the “target” notebook, but it doesn’t. Instead, it leads to temporary “Unsaved changes” (which is also a little confusing) on the merge page, which disappear unless you commit the merge to the base. It might also be nice if there was a message suggesting the “Compare reverse” button in case you don’t own the base.

Let me also add my thanks to the team for all their hard work!

4 Likes

Thanks Bryan! This is helpful. Thanks for all your amazing responses overall – you’ve been going hard at it for months now! It’ s a gift to have people such as yourself explicating the details for all of us ‘noobs’!

Wishing you a good weekend ahead.

1 Like

Hi @bgchen and everyone,

I am revisiting this topic since I still have the same confusion.

I have notebook that I forked. I made changed to the parent, and I want these changes in the fork.

The UI is counter-intuitive here. From the forked notebook, when I compare, there’s a button that allows me to apply missing changes from the parent in the fork, and yet my option for merging will affect the parent. I want to change the fork (and I am viewing from the fork). To effect changes to the fork, as @bgchen pointed out above, I first have to select ‘compare reverse’. This allows me to overwrite the fork completely with changes to the parent, but what about keeping the only changes from the parent that I want?

… Sorry, this is probably covered in the ‘How to’ guide and I am surely trying the patience of the community with my half-baked questions. Using Git, this all makes sense, but here I find myself doing a lot of mental acrobatics and UI trickery to perform what should be a relatively straight-forward operation in Observable…

Please let me know if I should just start a new topic.

I am still wondering whether it’s me, or whether Observable isn’t (yet) cut out for this…

I now have 2 notebooks (parent, child), and wish to accept edits from parent into child and then to keep editing. I can ‘merge’ changes (so to speak) in the UI, but cannot (that I know of) commit the merge. Also, starting from the child, I can edit the parent; and starting from the parent, I can edit the child? This seems obscure and backwards. It’s great to fork and compare, but I’m currently expecting more than what I understand to be permissible.

I am working with someone and we both have edited a primary and a fork, and now we want to update the fork with the changes that occured on the primary since the fork, we do not want to lose our changes made to fork. I think this is also what @aaron is asking and I wonder if there is a clear way of doing that (or a clear, this is not possible)

1 Like

@tomlarkworthy When viewing the suggestion, there is a button “compare reverse” at the top. That will let you cherry-pick changes from the parent.

The message “Missing changes” with its option “Apply” preselects all the changes that were made in your fork, so that only changes made in the parent should be left to merge in the diff.

Note that everything you do here, except for pressing the actual “Merge … changes” button, is temporary. To undo mistakes, simply reload the page.


As an aside, be aware that (afaik) Observable diffs by node ID, not cell names. If you removed a named cell in your fork and then later on added it back manually, it will appear as a new addition in the diff.