Get Notebook Differences - Amazon SageMaker

Get Notebook Differences

You can display the difference between the current notebook and the last checkpoint or the last Git commit using the Amazon SageMaker UI.

The following screenshot shows the menu from a Studio notebook.

Get the Difference Between the Last Checkpoint

When you create a notebook, a hidden checkpoint file that matches the notebook is created. You can view changes between the notebook and the checkpoint file or revert the notebook to match the checkpoint file.

By default, a notebook is auto-saved every 120 seconds and also when you close the notebook. However, the checkpoint file isn't updated to match the notebook. To save the notebook and update the checkpoint file to match, you must choose the Save notebook and create checkpoint icon ( ) on the left of the notebook menu or use the Ctrl + S keyboard shortcut.

To view the changes between the notebook and the checkpoint file, choose the Checkpoint diff icon ( ) in the center of the notebook menu.

To revert the notebook to the checkpoint file, from the main Studio menu, choose File then Revert Notebook to Checkpoint.

Get the Difference Between the Last Commit

If a notebook is opened from a Git repository, you can view the difference between the notebook and the last Git commit.

To view the changes in the notebook from the last Git commit, choose the Git diff icon ( ) in the center of the notebook menu.