Skip to content

Conversation

@Meriem-BenIsmail
Copy link
Member

@Meriem-BenIsmail Meriem-BenIsmail commented Nov 27, 2025

Fixes #392.
This PR introduces an optional workflow to help users keep cleaner Git histories when working with Jupyter notebooks.

  1. Clear-Outputs Prompt Before Commit
    When committing, if staged notebooks contain cell outputs, a dialog now appears offering two choices:
Screencast.from.2025-11-27.09-39-48.webm
  1. Git Setting: Always Clear Outputs
    A new configuration option has been added to the Git extension settings:
    When enabled, notebook outputs are automatically stripped before every commit, skipping the dialog entirely.
image

Implementation Details
Backend endpoints were added to:

  • detect staged notebooks with outputs.
  • clear outputs using jupyter nbconvert.

@github-actions
Copy link

Binder 👈 Launch a Binder on branch Meriem-BenIsmail/jupyterlab-git/clean-outputs

Copy link
Member

@afshin afshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Meriem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleaning Notebook cell outputs

3 participants