Version control of Mathematica notebooks

前端 未结 7 1069
时光取名叫无心
时光取名叫无心 2020-12-07 08:06

Mathematica notebooks are, of course, plaintext files -- it seems reasonable to expect that they should play nice with a version-control system (git in my case, although I d

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 08:19

    It's recommended to disable the file outline cache, which is the metadata you're referring to when you look at the notebook with a text editor. As you discovered, it can cause merge conflicts if multiple parties are editing the same notebook.

    This is easily disabled with the Option Inspector. In the Mathematica menu, go to FormatOption Inspector..., in the top-left set the scope dropdown to Selected Notebook and search for FileOutlineCache in the search field. Set the option to False and save your notebook, and you should be all set.

    Note that this can make opening notebooks a little slower, but unless the notebook is rather large, you probably won't notice the difference.

提交回复
热议问题