这是indexloc提供的服务,不要输入任何密码
Skip to content

committing notebook code changes with nbdime and git-lfs for the notebook itself (both at the same time) #771

@nnWhisperer

Description

@nnWhisperer

Hello,
Thank you for the great work. I'm new to nbdime and git-lfs, and the ML community may already be using solutions (which I'm not aware) that solves my question. Given that,

  1. In git, the generated contents such as binaries or other output etc are generally kept track with git-lfs without duplicating them in the git's internal files in .git folder. Normal source code is kept track with git as usual.
  2. Jupyter/ipython notebooks are different in the sense that a single file contains both the source code in the code/markdown cells and generated content/outputs in the cell outputs.
  3. nbdime can be used to provide improved git diff experience by restructuring the ipynb(json) into a markdown(and hiding some fields) under the hood, making the notebook diffs readable. nbdime can also be used to filter out the cell outputs from display.

So, my question is, is it possible to commit the ipynb file (asis - both with input and outputs) by git-lfs while committing only the source codes in notebooks in the usual git (filtering out the outputs), hence have the best of both worlds? I'm afraid that if we git-lfs the file, it will commit source code as well that might prevent git to recognize the source code changes and if we use nbdime only, the changed output won't be kept track.
There might be a best-practice that I'm not aware of. Thank you for sharing it with me and replying.

I'm referring to markdown and code cell inputs as 'source code' and code cell output as outputs in the question description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions