Fork, Share, Merge The ability for anyone to suggest changes, and for authors to merge changes quickly and accurately, has been essential to the success of open source: if you remove the friction of collaboration, people will work together! Today we’re excited to announce our Merge button, bringing Git-style asynchronous collaboration to Observable’s interactive programming environment. Say I publish a notebook mapping life expectancy around the world. My choropleth of global life expectancy. Although I’m quite pleased with it, my colleague Mike notices that I’ve used the Mercator projection. Oops! This isn’t a good choice for a choropleth as it grossly exaggerates the size of countries near the poles.
1. Fork to make changes. This is Observable, so Mike doesn’t merely imagine what my choropleth would look like with a more appropriate equal-area projection—he edits my notebook and changes it! (He couldn’t resist making a few other tweaks, too.) Mike changes the projection in a fork.
2. Share the fork. Mike likes his improvements. Rather than keep them to himself, he clicks “Share link” in the notebook menu and sends me a link to his fork. Mike shares his fork, allowing me to read it.
3. Review and merge the suggested changes. From Mike’s link, I click “Compare fork” to see what’s changed. A fork can be compared to its parent. This quickly reveals what Mike added (green) and removed (red). Comparing my notebook to Mike’s fork. I can toggle the Before and After in each cell to evaluate the changes. If I choose, I can even edit a cell to make further changes. The changes look good, so I click the blue Merge button at the top. Mike’s changes, and any further changes I made while comparing, are now applied to my notebook!
4. Republish. 🎉 I’m not quite done: Mike’s changes were applied, but they’re only visible to me. My revised notebook, post-merge but pre-(re-)publish. I republish to let everyone see the data in proper equal-area form. The republished notebook in all its glory. I think you’ll agree: my notebook is better thanks to collaboration. The next time you find yourself reading a notebook and thinking, “Huh, that could have been done better,” don’t keep that thought to yourself. Fork, share, and merge!