Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nnWhisperer opened this issue Sep 20, 2024 · 0 comments

Comments

@nnWhisperer
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant